Open modiboa opened 3 years ago
After some testing, I found that if I set the maven-surefire-plugin
configuration in the parent pom.xml I got the exception, but if I move the configuration to the child pom (module where the tests are) I can run fine with IntelliJ (Ctrl+Shit+F10).
My configuration:
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
</argLine>
</configuration>
</plugin>
</plugins>
</build>
ps: I tested adding the configuration inside parent pom <plugins>
and <pluginManagement>
as well...
It seems the root cause is when the project uses both maven-surefire-plugin
and maven-failsafe-plugin
with a configured <argLine>
. I think what happens is that IntelliJ will automatically add the <argLine>
from both plugins into the Test Runner.
If I disabled the argLine
option I got the error of not found argLine. But If I enabled I got the exception above
I commented about this in the IntelliJ issue tracker https://youtrack.jetbrains.com/issue/IDEA-199109
argLine
parameter-ea -javaagent:/home/youruser/.m2/repository/org/jmockit/jmockit/1.49/jmockit-1.49.jar
The tests are running fine with
mvn verify
in the command line, but when I try to run using IntellJ I got the following errorJunit 4.12
Anyone has any ideas?