Skip to content

Commit 95611cf

Browse files
authored
Favor maven-dependency-plugin to obtain coverage agent JAR (#15)
1 parent 8bc70cc commit 95611cf

File tree

1 file changed

+28
-10
lines changed
  • JVM/intellij-coverage-agent/maven

1 file changed

+28
-10
lines changed

JVM/intellij-coverage-agent/maven/pom.xml

+28-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<maven.compiler.target>17</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<junit.jupiter.version>5.7.2</junit.jupiter.version>
16-
<intellij.coverage.agent.version>1.0.725</intellij.coverage.agent.version>
16+
<intellij.coverage.agent.version>1.0.746</intellij.coverage.agent.version>
1717
<intellij.agent.options>${project.basedir}/.qodana/code-coverage/output.ic,true,true,true,false</intellij.agent.options>
1818
</properties>
1919

@@ -32,25 +32,43 @@
3232
<version>${junit.jupiter.version}</version>
3333
<scope>test</scope>
3434
</dependency>
35-
<!-- IntelliJ Coverage Agent -->
36-
<dependency>
37-
<groupId>org.jetbrains.intellij.deps</groupId>
38-
<artifactId>intellij-coverage-agent</artifactId>
39-
<version>${intellij.coverage.agent.version}</version>
40-
<scope>test</scope>
41-
</dependency>
4235
</dependencies>
4336

4437
<build>
4538
<plugins>
39+
<plugin>
40+
<groupId>org.apache.maven.plugins</groupId>
41+
<artifactId>maven-dependency-plugin</artifactId>
42+
<version>3.6.1</version>
43+
<executions>
44+
<execution>
45+
<id>intellij-coverage-agent</id>
46+
<phase>process-test-classes</phase>
47+
<goals>
48+
<goal>copy</goal>
49+
</goals>
50+
<configuration>
51+
<artifactItems>
52+
<!-- IntelliJ Coverage Agent -->
53+
<artifactItem>
54+
<groupId>org.jetbrains.intellij.deps</groupId>
55+
<artifactId>intellij-coverage-agent</artifactId>
56+
<version>${intellij.coverage.agent.version}</version>
57+
<destFileName>intellij-coverage-agent.jar</destFileName>
58+
</artifactItem>
59+
</artifactItems>
60+
</configuration>
61+
</execution>
62+
</executions>
63+
</plugin>
4664
<plugin>
4765
<groupId>org.apache.maven.plugins</groupId>
4866
<artifactId>maven-surefire-plugin</artifactId>
49-
<version>2.22.2</version>
67+
<version>3.2.5</version>
5068
<configuration>
5169
<!-- Specify the IntelliJ coverage agent -->
5270
<argLine>
53-
-javaagent:${settings.localRepository}/org/jetbrains/intellij/deps/intellij-coverage-agent/${intellij.coverage.agent.version}/intellij-coverage-agent-${intellij.coverage.agent.version}.jar=${intellij.agent.options}
71+
-javaagent:${project.build.directory}/dependency/intellij-coverage-agent.jar=${intellij.agent.options}
5472
</argLine>
5573
</configuration>
5674
</plugin>

0 commit comments

Comments
 (0)