我使用scalatest-maven-plugin最新1.0版本,其中source code here。试图并行运行我的套房和使用以下配置:Scalatest maven插件:错误:-c已被弃用很长时间,不再支持
<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的插件是通过-c
到scalatest CLI而不是正确的-P
..或甚至更好-P10
即使用的线程数。
如何通过Maven将-P10
传递给scalatest进程?我试图直接在MAVEN_OPTS
环境变量或Maven CLI中设置它,但它没有被拾取。
我也曾尝试配置scalatest - Maven的插件是这样的:
<configuration>
<argLine>-P10</argLine>
</configuration>
但此参数是传递给Java进程,而不是到Scalatest所以它失败了。