I am trying to run my unit tests through sure-fire plugin with two different arguments. One using jacoco to feed in test results into SonarQube and the other is to run in dynatrace. I tried putting it in two different execution tags but doesnt seem to work properly. Please help me as to what I am doing wrong? Below is the snippet from my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<argLine>${jacoco.ut.arg}</argLine>
<argLine>-agentpath:"C:\Program Files\dynaTrace\Dynatrace 6.3\agent\lib64\dtagent.dll"=name=JavaAgent,server=localhost:9998,optionTestRunIdJava=${dtTestrunID}</argLine>
<excludes>
<exclude>**/at/**</exclude>
<exclude>**/it/**</exclude>
</excludes>
</configuration>
</plugin>
You need to use
<executions/>. Consider the following example:Have a look at the Maven POM Reference: