OpenMRS Standalone [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:2.0.5:update (empty-database-create-schema)

Application Name: OpenMRS Standalone
Version Number: openmrs.version=2.1.4, refapp.version=2.8.0

Question: I am encountering a mysql connection error on Mac machine when attempting to package the OpenMRS Standalone from this repository: https://github.com/openmrs/openmrs-standalone using branch openmrs-emr2.

  1. To reproduce error, clone the repository on a mac machine.
  2. Navigate to the root directory.
  3. Run this command to increase mvn memory to allow complete package: export MAVEN_OPTS="-Xms1012m -Xmx2024m -XX:PermSize=556m -XX:MaxPermSize=1012m"
  4. Run this command to attempt to package: mvn clean package -Dopenmrs.version=2.1.4 -Drefapp.version=2.8.0

ERROR MESSAGE: [INFO] Scanning for projects… [INFO] [INFO] ------------< org.openmrs:referenceapplication-standalone >------------- [INFO] Building referenceapplication-standalone 2.6.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] — maven-clean-plugin:2.5:clean (default-clean) @ referenceapplication-standalone — [INFO] [INFO] — maven-enforcer-plugin:1.0:enforce (enforce-property) @ referenceapplication-standalone — [INFO] [INFO] — liquibase-maven-plugin:2.0.5:update (empty-database-create-schema) @ referenceapplication-standalone — [INFO] ------------------------------------------------------------------------ [INFO] Loading artfacts into URLClassLoader [INFO] artifact: file:/Users/anthonymcintosh/.m2/repository/org/apache/tomcat/tomcat-catalina/7.0.50/tomcat-catalina-7.0.50.jar [INFO] artifact: file:/Users/anthonymcintosh/.m2/repository/org/apache/tomcat/tomcat-coyote/7.0.50/tomcat-coyote-7.0.50.jar [INFO] artifact: file:/Users/anthonymcintosh/.m2/repository/org/apache/tomcat/tomcat-jasper/7.0.50/tomcat-jasper-7.0.50.jar [INFO] artifact: file:/Users/anthonymcintosh/.m2/repository/mysql/mysql-connector-java/5.1.28/mysql-connector-java-5.1.28.jar [INFO] artifact: file:/Users/anthonymcintosh/.m2/repository/mysql/mysql-connector-mxj-fixed/5.0.12/mysql-connector-mxj-fixed-5.0.12.jar [INFO] artifact: file:/Users/anthonymcintosh/.m2/repository/mysql/mysql-connector-mxj-db-files-fixed/5.0.12-20170418/mysql-connector-mxj-db-files-fixed-5.0.12-20170418.jar [INFO] artifact: file:/Users/anthonymcintosh/Documents/git/GitHub/openmrs-standalone/target/classes [INFO] artifact: file:/Users/anthonymcintosh/Documents/git/GitHub/openmrs-standalone/target/test-classes [INFO] ------------------------------------------------------------------------ [INFO] Settings---------------------------- [INFO] driver: com.mysql.jdbc.Driver [INFO] url: jdbc:mysql:mxj://127.0.0.1:33326/openmrs?autoReconnect=true&sessionVariables=storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8&server.initialize-user=true&createDatabaseIfNotExist=true&server.basedir=/Users/anthonymcintosh/Documents/git/GitHub/openmrs-standalone/target/emptydatabase&server.datadir=/Users/anthonymcintosh/Documents/git/GitHub/openmrs-standalone/target/emptydatabase/data&server.collation-server=utf8_general_ci&server.character-set-server=utf8&server.max_allowed_packet=32M [INFO] username: openmrs [INFO] password: test [INFO] use empty password: false [INFO] properties file: null [INFO] properties file will override? false [INFO] prompt on non-local database? true [INFO] clear checksums? false [INFO] changeLogFile: liquibase-schema-only.xml [INFO] context(s): null [INFO] number of changes to apply: 0 [INFO] drop first? false [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.632 s [INFO] Finished at: 2019-03-27T08:47:07-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:2.0.5:update (empty-database-create-schema) on project referenceapplication-standalone: Error setting up or running Liquibase: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.: Can’t create database ‘openmrs’ (errno: 2) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [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 read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@mcintoac2442 , what was exactly the whole porpose for doing this … ?? what did you intend to do??

I am contributing to the OpenMRS StandAlone via JIRA Ticket STAND91.

To do this I would like to be able to package the git repository where I will add the feature into the distributable version for users.

Thank you.

Alryt, do you get the above reported error before adding your changes or after your local changes??

This error is from a non-changed version of the current OpenMRS Standalone, as per the steps to reproduce instructions and GitHub link provided.

i ddint get that ?? did you try to mean a fresh clone without any of your changes??

ok if you meant a fresh clone of the standalone. try doing this .

  • Clean your .m2/repository folder

  • restart your computer

  • Get a freash clone of the standalone

  • run mvn clean instal -U

Yes I am working with a fresh clone of the standalone.

I cleaned my .m2/repository folder.

The mvn clean install -U command did not work for me, because the command must specify OpenMRS version numbers for the standalone and reference application.

I am attempting to package using mvn clean package -Dopenmrs.version=2.1.4 -Drefapp.version=2.8.0 instead, and it is still failing on the liquibase create scheme step with the same error.

I should restate, this is being done on the openmrs-emr2 branch of the standalone.