# Build Failure Of A Distribution Type Server

**URL:** <https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228>\
**Category:** Development\
**Created:** [April 27, 2017, 7:35am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228 "2017-04-27T07:35:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)\
**Post date:** [April 27, 2017, 7:35am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/1 "2017-04-27T07:35:40Z")

</div>

Hi!!! Am Samuel, I’m relatively new to OpenMRS and I have just started off with the OpenMRS-SDK… But I’m consistently getting a BUILD FAILURE whenever I try making a distribution type server. Could the problem be with the MySQL data setup OR??

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [April 27, 2017, 8:22am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/2 "2017-04-27T08:22:01Z")

</div>

What command are you running, and what error are you getting?

---

<div class="post-metadata">

**Author:** ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)\
**Post date:** [April 27, 2017, 8:39am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/3 "2017-04-27T08:39:15Z")

</div>

Hey! @ssmusoke, the command I use is given below:) mvn openmrs-sdk:setup -DserverId=distro-2-3-1 -Ddistro=referenceapplication:2.3.1 -DdbUri=jdbc:mysql://localhost:3306/distro-2-3-1 -DdbUser=root -DdbPassword=Root123 -DjavaHome=“C:\Program Files\Java\jdk1.7.0\_51” And I receive the following error: [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 29.723 s [INFO] Finished at: 2017-04-27T11:33:25+03:00 [INFO] Final Memory: 20M/225M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugi n:3.9.0:setup (default-cli) on project standalone-pom: Failed to setup server: F ailed to connect to the specified database jdbc:mysql://localhost:3306/distro-2- 3-1?autoReconnect=true&sessionVariables=storage\_engine%3DInnoDB&useUnicode=true& characterEncoding=UTF-8 -\> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] [http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE](http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE) xception

C:\Users\SAM\>

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [April 27, 2017, 8:41am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/4 "2017-04-27T08:41:49Z")

</div>

What do you get when you run this command

`mvn openmrs-sdk:setup -Ddistro=referenceapplication:2.3.1`

The rest of the options can be provided through the wizard

---

<div class="post-metadata">

**Author:** ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)\
**Post date:** [April 27, 2017, 8:51am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/5 "2017-04-27T08:51:19Z")

</div>

Man, its a build failure again!! Have close look from there!!! … Which database would you like to use?:

1. MySQL 5.6 (requires pre-installed MySQL 5.6)
2. MySQL 5.6 in SDK docker container (requires pre-installed Docker)
3. Existing docker container (requires pre-installed Docker)

Which one do you choose? [1/2/3]: 1

The distribution requires MySQL database. Please specify database uri (-DdbUri) (default: ‘jdbc:mysql://localhost:3306/@DBNAME@’):

Please specify database username (-DdbUser) (default: ‘root’): Please specify database password (-DdbPassword) (default: ’ '): [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:10 min [INFO] Finished at: 2017-04-27T11:44:43+03:00 [INFO] Final Memory: 20M/233M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugi n:3.9.0:setup (default-cli) on project standalone-pom: Failed to setup server: F ailed to connect to the specified database jdbc:mysql://localhost:3306/samserver ?autoReconnect=true&sessionVariables=storage\_engine%3DInnoDB&useUnicode=true&cha racterEncoding=UTF-8 -\> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] [http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE](http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE) xception

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [April 27, 2017, 9:29am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/6 "2017-04-27T09:29:44Z")

</div>

You have to enter the appropriate username and password, if you did then the problem is with your database connection

---

<div class="post-metadata">

**Author:** ![taremwatadeo](https://talk.openmrs.org/user_avatar/talk.openmrs.org/taremwatadeo/32/17685_2.png) [@taremwatadeo](https://talk.openmrs.org/u/taremwatadeo)\
**Post date:** [April 27, 2017, 9:31am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/7 "2017-04-27T09:31:56Z")

</div>

> [@samuel34](#):
>
> The distribution requires MySQL database. Please specify database uri (-DdbUri)(default: ‘jdbc:mysql://localhost:3306/@DBNAME@’):

This often happens if you did not add the path of your mysql server to the environment variables

---

<div class="post-metadata">

**Author:** ![samuel34](https://talk.openmrs.org/user_avatar/talk.openmrs.org/samuel34/32/17813_2.png) [@samuel34](https://talk.openmrs.org/u/samuel34)\
**Post date:** [April 27, 2017, 9:44am UTC](https://talk.openmrs.org/t/build-failure-of-a-distribution-type-server/11228/8 "2017-04-27T09:44:56Z")

</div>

Hey! Am now confused coz I added the path… Have a look at my path …C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;D:\Java\jdk1.8.0\_121\bin;C:\Users\SAM\Desktop\sam\Java\jre1.8.0\_121\bin;C:\Program Files\New folder\apache-maven-3.3.9\bin;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\MySQL\MySQL Utilities 1.6  
Is the path perfect that way???
