【发布时间】:2017-02-15 08:58:39
【问题描述】:
我正在使用scalatest-maven-plugin 最新的 1.0 版本和source code here。尝试并行运行我的套件并使用以下配置:
<build><plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>WDF TestSuite.txt</filereports>
<htmlreporters>${project.build.directory}/html/scalatest</htmlreporters>
<parallel>true</parallel>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin></build>
导致以下 Maven 构建错误:
[INFO]
[INFO] --- scalatest-maven-plugin:1.0:test (test) @ myproject ---
Exception in thread "ScalaTest-main" java.lang.IllegalArgumentException: ERROR: -c has been deprecated for a very long time and is no longer supported, to prepare for reusing it for a different purpos
e in the near future. Please change all uses of -c to -P.
at org.scalatest.tools.ArgsParser$.checkArgsForValidity(ArgsParser.scala:46)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:857)
at org.scalatest.tools.Runner$.main(Runner.scala:827)
at org.scalatest.tools.Runner.main(Runner.scala)
基本上,scalatest-maven-plugin 将-c 传递给scalatest CLI,而不是正确的-P .. 甚至更好的-P10,即要使用的线程数。
如何通过 Maven 将 -P10 传递给 scalatest 进程?我尝试在MAVEN_OPTS 环境变量或直接在Maven CLI 中设置它,但它没有被拾取。
我也尝试过像这样配置 scalatest-maven-plugin:
<configuration>
<argLine>-P10</argLine>
</configuration>
但是这个参数被传递给java进程而不是Scalatest所以它也失败了。
【问题讨论】:
标签: xml maven maven-plugin scalatest scalatest-maven-plugin