Skip to content

Commit 24259b0

Browse files
调整主pom的cobertura插件配置,让他能集成多模块的测试用例;
这次提交也没有正确生成完整的代码覆盖率报告,好郁闷
1 parent 5b8ccc6 commit 24259b0

File tree

4 files changed

+62
-11
lines changed

4 files changed

+62
-11
lines changed

pom.xml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45

56
<groupId>com.alibaba.jvm.sandbox</groupId>
@@ -67,6 +68,12 @@
6768
</executions>
6869
</plugin>
6970

71+
<plugin>
72+
<groupId>org.codehaus.mojo</groupId>
73+
<artifactId>cobertura-maven-plugin</artifactId>
74+
<version>2.7</version>
75+
</plugin>
76+
7077
<!-- 为了发布到MAVEN中央仓库而用的插件 -->
7178
<plugin>
7279
<groupId>org.sonatype.plugins</groupId>
@@ -96,17 +103,17 @@
96103
<plugin>
97104
<groupId>org.codehaus.mojo</groupId>
98105
<artifactId>cobertura-maven-plugin</artifactId>
99-
<version>2.7</version>
100106
<configuration>
101107
<outputDirectory>./target/tmpCobertura</outputDirectory>
108+
<aggregate>true</aggregate>
109+
<check/>
102110
<formats>
103111
<format>html</format>
104112
<format>xml</format>
105113
</formats>
106-
<aggregate>true</aggregate>
107-
<check />
108114
</configuration>
109115
</plugin>
116+
110117
</plugins>
111118
</build>
112119

@@ -121,8 +128,8 @@
121128
<module>sandbox-mgr-provider</module>
122129
<module>sandbox-module-starter</module>
123130
<module>sandbox-debug-module</module>
124-
<module>sandbox-qatest</module>
125-
</modules>
131+
<module>sandbox-qatest</module>
132+
</modules>
126133

127134
<dependencyManagement>
128135
<dependencies>
@@ -164,7 +171,7 @@
164171
<artifactId>javax.annotation-api</artifactId>
165172
<version>1.2</version>
166173
</dependency>
167-
174+
168175
<dependency>
169176
<groupId>org.kohsuke.metainf-services</groupId>
170177
<artifactId>metainf-services</artifactId>
@@ -188,8 +195,8 @@
188195
</repository>
189196
</distributionManagement>
190197

191-
<description>Alibaba jvm-sandbox OpenSource Project</description>
192-
<url>https://github.com/alibaba/jvm-Sandbox</url>
198+
<description>Alibaba JVM-SANDBOX OpenSource Project</description>
199+
<url>https://github.com/alibaba/jvm-sandbox</url>
193200

194201
<licenses>
195202
<license>
@@ -222,5 +229,4 @@
222229
<url>https://github.com/alibaba/jvm-sandbox</url>
223230
</scm>
224231

225-
226232
</project>

sandbox-debug-module/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@
2222
<skip>true</skip>
2323
</configuration>
2424
</plugin>
25+
<plugin>
26+
<groupId>org.codehaus.mojo</groupId>
27+
<artifactId>cobertura-maven-plugin</artifactId>
28+
<configuration>
29+
<skip>true</skip>
30+
<check/>
31+
</configuration>
32+
<executions>
33+
<execution>
34+
<goals>
35+
<goal>cobertura</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
</plugin>
2540
</plugins>
2641
</build>
2742

sandbox-module-starter/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@
3232
</execution>
3333
</executions>
3434
</plugin>
35+
<plugin>
36+
<groupId>org.codehaus.mojo</groupId>
37+
<artifactId>cobertura-maven-plugin</artifactId>
38+
<configuration>
39+
<skip>true</skip>
40+
<check/>
41+
</configuration>
42+
<executions>
43+
<execution>
44+
<goals>
45+
<goal>cobertura</goal>
46+
</goals>
47+
</execution>
48+
</executions>
49+
</plugin>
3550
</plugins>
3651
</build>
3752

sandbox-qatest/pom.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,25 @@
1818
<groupId>org.apache.maven.plugins</groupId>
1919
<artifactId>maven-surefire-plugin</artifactId>
2020
<configuration>
21-
<forkMode>pertest</forkMode>
21+
<forkMode>once</forkMode>
2222
<argLine>-Xbootclasspath/p:./lib/sandbox-spy-1.1.0-for-qatest.jar</argLine>
2323
</configuration>
2424
</plugin>
25+
<plugin>
26+
<groupId>org.codehaus.mojo</groupId>
27+
<artifactId>cobertura-maven-plugin</artifactId>
28+
<configuration>
29+
<skip>true</skip>
30+
<check/>
31+
</configuration>
32+
<executions>
33+
<execution>
34+
<goals>
35+
<goal>cobertura</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
</plugin>
2540
</plugins>
2641
</build>
2742

0 commit comments

Comments
 (0)