Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 带有maven故障保护插件的VM参数_Java_Maven_Continuous Integration_Build Automation_Maven Plugin - Fatal编程技术网

Java 带有maven故障保护插件的VM参数

Java 带有maven故障保护插件的VM参数,java,maven,continuous-integration,build-automation,maven-plugin,Java,Maven,Continuous Integration,Build Automation,Maven Plugin,我正试图将一个VM参数传递给Maven,特别是针对failsafe运行的一组测试 我的pom.xml如下所示: ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <argLine>-Dtest.data=t

我正试图将一个VM参数传递给Maven,特别是针对failsafe运行的一组测试

我的pom.xml如下所示:

...
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <configuration>
    <argLine>-Dtest.data=true</argLine>
  </configuration>
  <version>2.7.2</version>
  <executions>
    <execution>
      <id>integration-test</id>
      <goals>
        <goal>integration-test</goal>
      </goals>
    </execution>
    <execution>
      <id>verify</id>
      <goals>
        <goal>verify</goal>
      </goals>
    </execution>
  </executions>
</plugin>
...
。。。
org.apache.maven.plugins
maven故障保护插件
-Dtest.data=true
2.7.2
集成测试
集成测试
验证
验证
...
当我运行命令
mvn clean verify
时,依赖test.data设置为true的测试失败。但是,当我运行命令
mvn-Dtest.data=true clean verify
时,测试都通过了。我需要在我的CI环境的pom中设置参数

我是不是遗漏了什么

提前感谢,

Pete

使用
元素(我看不出文档中提到了
,您在哪里找到的?)


真的

好的,我尝试运行的集成测试需要将此参数传递到Tomcat插件,而不是故障保护插件。谢谢你们的帮助,伙计们

第一个建议是升级到Maven FailSafe插件的2.8版本。你是在为JVM分岔吗?我已经更新到2.8,但仍然无法工作。我如何知道我是否正在分叉JVM?我不相信我是。默认设置说你在分叉。我也尝试过,但仍然不起作用。是在源代码中,但我没有检查文档。以下是maven failsafe插件的文档:我看到了相同的问题,但因为我没有使用Tomcat,所以无法以这种方式修复它。最后,我已经调整了Jenkins的工作,在构建部分指定了:clean test-Dsun.net.http.allowertrictedheaders=true
<configuration>
    <systemPropertyVariables>
        <test.data>true</test.data>
    </systemPropertyVariables>
</configuration>