我使用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所以它失敗了。