What Maven goal do you run to cause this problem? This sounds like a configuration problem. You have the Liquibase plugin set to run in the pre-integration-test phase which means you will need to specifically need to target the integration-test goal for it to fire.
This didn’t fire the Liquibase plugin: mvn test
This did fire the Liquibase plugin: mvn integration-test
Try using the integration-test goal.
I have run the mvn integration-test phase on the Command Prompt but still there are problems. It throws the following Exception:
Caused by: org.hibernate.HibernateException: Missing table: employee
I am specificing the following in the pom.xml:
-
< plugins >
-
- < groupId > org.apache.maven.plugins </ groupId >
-
< artifactId > maven -failsafe-plugin </ artifactId>
-
< version > 2.12.4 </ version >
-
-
-
< encoding > utf-8 </ encoding >
-
-
-
-
-
-
-
-
-
-
< goal > integration-test </ goal >
-
-
< goal > verify </ goal >
-
-
-
-
-
-
-
-
-
-
-
-
< groupId > org.liquibase </ groupId >
-
-
< artifactId > liquibase -maven-plugin </ artifactId >
-
-
< version > 3.2.2 </ version >
-
-
-
-
< propertyFile > src/main/resources/server-internal2.properties </ propertyFile >
-
-
< changeLogFile > src/main/resources/db-changelog-employee.xml </ changeLogFile >
-
-
< promptOnNonLocalDatabase > false </ promptOnNonLocalDatabase >
-
-
< logging > debug </ logging >
-
-
-
-
-
-
-
-
< phase > pre -integration-test </ phase >
-
-
-
-
< goal > update </ goal >
-
-
-
-
-
-
-
-
</ plugin >
The liquibase plugin is creating the tables but they can’t be found. What is wrong? Could you please look at the example project: https://github.com/rajivj2/example2/ on GitHub.
Since the Liquibase plugin is creating the tables, it sounds like you got the Liquibase part working. Not sure I can help you with your general project issues.
It doesn’t sound like a Hibernate issue to me. I have a hunch it is your HSQLDB settings. I bet the failsafe plugin forks the process and the HSQLDB in-memory database is shutting down as it is only available to the creating JVM process. I would try not forking the failsafe plugin if you can or switching to file or server mode on the HSQLDB database so the data is persisted between processes.
That being said, this is probably not the best place for general Java project setup questions.