[英]How to start/stop hsqldb using maven?
我正在嘗試使用maven啟動和停止hsqldb。 我想在測試階段之前使用特定配置(數據庫)啟動hsqldb服務器,然后在應用程序啟動之前和之后將其停止並與其他配置相同。
目前我用maven exec插件啟動hsqldb,但問題是服務器啟動阻止了完整的maven構建過程(按CTRL + C來停止服務器。)此外,沒有自動停止服務器的解決方案。
最好的祝福
Hemeroc
檢查我的hsqldb maven插件: https : //github.com/avianey/hsqldb-maven-plugin
您可以像jetty-maven-plugin或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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.