通过maven exec插件启动hsqldb服务器失败
我尝试启动一个hsqldb服务器以供开发使用。我有hsqldb依赖项:通过maven exec插件启动hsqldb服务器失败,hsqldb,maven-3,Hsqldb,Maven 3,我尝试启动一个hsqldb服务器以供开发使用。我有hsqldb依赖项: <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>2.2.4</version> </dependency> 我搜索了代码,这个错误是什么意思,然后在hsqldb代码中找到了这个页面上的错误=>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.4</version>
</dependency>
我搜索了代码,这个错误是什么意思,然后在hsqldb代码中找到了这个页面上的错误=>
因此hsqldb将“无有效的数据库路径:maformed database enumerator:server.database.0 mem:monitoring”用作键all参数
看起来像是个虫子,还是我做错了什么
好的,我找到了解决方案,我改变了给exec maven插件提供参数的方式
由此:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0 file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0 file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
org.codehaus.mojo
execmaven插件
1.2.1
JAVA
org.hsqldb.server.server
--数据库.0文件:目标/监视
为此:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0</argument>
<argument>file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0</argument>
<argument>file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
org.codehaus.mojo
execmaven插件
1.2.1
JAVA
org.hsqldb.server.server
--数据库.0
文件:目标/监控
它可以工作我改变了我将参数传递给exec maven插件的方式 由此:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0 file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0 file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
org.codehaus.mojo
execmaven插件
1.2.1
JAVA
org.hsqldb.server.server
--数据库.0文件:目标/监视
为此:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0</argument>
<argument>file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.hsqldb.server.Server</mainClass>
<arguments>
<argument>--database.0</argument>
<argument>file:target/monitoring</argument>
</arguments>
</configuration>
</plugin>
org.codehaus.mojo
execmaven插件
1.2.1
JAVA
org.hsqldb.server.server
--数据库.0
文件:目标/监控
它可以工作我发现,如果您需要从maven以服务器模式启动HSQL并继续运行集成测试,您必须使用maven antrun插件和ant Java任务,因为exec maven插件不支持分叉模式:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<dependencies>
</dependencies>
<executions>
<execution>
<phase>pre-integration-test</phase>
<configuration>
<target>
<property name="test_classpath" refid="maven.test.classpath" />
<java classname="org.hsqldb.server.Server"
fork="yes" spawn="yes">
<arg
line="--database.0 mem:test --dbname.0 test" />
<classpath>
<pathelement path="${test_classpath}" />
</classpath>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
org.apache.maven.plugins
maven antrun插件
1.6
预集成测试
跑
它假定您的hsqldb依赖项属于测试范围。通过命令行“mvn exec:java-Dexec.mainClass=“org.hsqldb.server.server”-Dexec.args=“--database.0 file:target/monitoring”确定“,它工作起来很有魅力,所以我的问题来自exec maven插件Arguments我刚刚找到了解决方案我将此=>--database.0文件:target/monitoring替换为--database.0文件:target/monitoring请添加您的解决方案作为答案,以便其他人可以更轻松地找到它。当然,但我无法在8小时之前完成。谢谢,这正是我所需要的。令人难以置信的是,maven不支持这一点。