如何与maven surefire插件并行运行scalatest?

如何与maven surefire插件并行运行scalatest?,maven,scalatest,maven-surefire-plugin,parallel-testing,Maven,Scalatest,Maven Surefire Plugin,Parallel Testing,我正在从事一个scala项目,该项目使用Maven构建并运行用scalatest编写的测试 测试如下: import org.scalatest.ParallelTestExecution @RunWith(classOf[org.scalatest.junit.JUnitRunner]) class MyTest extends FunSuite with ParallelTestExecution { // some tests } 从一些问题中,我知道如果我们给scalatest

我正在从事一个scala项目,该项目使用Maven构建并运行用scalatest编写的测试

测试如下:

import org.scalatest.ParallelTestExecution

@RunWith(classOf[org.scalatest.junit.JUnitRunner])
class MyTest extends FunSuite with ParallelTestExecution {
   // some tests
}
从一些问题中,我知道如果我们给scalatest一个
-p
参数,它将并行运行测试

但我不确定如何使用
maven-surefire-plugin
配置它,我尝试添加
-p
,但这导致JVM无法启动:

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <argLine>-P</argLine>
    </configuration>
</plugin>

maven surefire插件
-P

有什么办法吗?如果我们不能使用maven surefire插件,是否可以仅在测试中配置它?

如果您的所有测试都是使用scalatest编写的,那么您应该使用scalatest maven插件而不是surefire。有

文件:

资料来源:

请注意,如果确实使用scalatest maven插件,那么就不能在代码中使用java测试。如果您混合了java/scala项目,那么使用surefire和@RunWith装饰是我所知道的唯一方法