How to start / stop hsqldb using maven?

I am trying to start and stop hsqldb using maven. I want to start the hsqldb server with a specific configuration (database) before the testing phase and then stop it and do the same with a different configuration before and after starting the application.

I am currently running hsqldb using the maven exec plugin, but the problem is that starting the server blocks the complete maven build process (Hit CTRL + C to stop the server.) There is also no solution to automatically stop the server.

Best wishes

Hemeroc

+4
source share
1 answer

check out my hsqldb maven plugin: https://github.com/avianey/hsqldb-maven-plugin

You can simply start / stop it, like a jetty-maven-plugin or tomee-maven-plugin:

<plugin> <!-- current version --> <groupId>fr.avianey.mojo</groupId> <artifactId>hsqldb-maven-plugin</artifactId> <version>1.0.0</version> <!-- default value for in memory jdbc:hsqldb:hsql://localhost/xdb override only values you want to change --> <configuration> <driver>org.hsqldb.jdbcDriver</driver> <path>mem:test</path> <address>localhost</address> <name>xdb</name> <username>sa</username> <password></password> <validationQuery>SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS</validationQuery> </configuration> <!-- call start and stop --> <executions> <execution> <id>start-hsqldb</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> </execution> <execution> <id>stop-hsqldb</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> </executions> </plugin> 
+7
source

All Articles