]> source.dussan.org Git - archiva.git/commitdiff
add a profile for coverage (jacoco-coverage)
authorEric Barboni <skygo@apache.org>
Tue, 30 Sep 2014 21:05:24 +0000 (23:05 +0200)
committerEric Barboni <skygo@apache.org>
Tue, 30 Sep 2014 21:06:57 +0000 (23:06 +0200)
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-web-common/pom.xml
archiva-modules/archiva-web/archiva-webdav/pom.xml
pom.xml

index 1b6bfa2c6eb6fbe9531d2f7bcf60f388003cd2d9..37d9c39d7b11823c74dcd87ac3e0e4587ab05cac 100644 (file)
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>-Xmx512m -Xms512m -server -XX:MaxPermSize=256m</argLine>
+          <argLine>-Xmx512m -Xms512m -server -XX:MaxPermSize=256m ${jacocoagent}</argLine>
           <systemPropertyVariables>
             <appserver.base>${project.build.directory}/appserver-base</appserver.base>
             <plexus.home>${project.build.directory}/appserver-base</plexus.home>
index 7ef97ce472a16c9b79ac2ecd4222a077047900ec..755afe035c634019d5ce052b95d2587bad3bda48 100644 (file)
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>-Xmx1024m -Xms512m -XX:MaxPermSize=256m</argLine>
+          <argLine>-Xmx1024m -Xms512m -XX:MaxPermSize=256m ${jacocoagent}</argLine>
           <systemPropertyVariables>
             <appserver.base>${project.build.directory}/appserver-base</appserver.base>
             <plexus.home>${project.build.directory}/appserver-base</plexus.home>
index 1ca2e0e2eba4101051f02b9ddd734e9e6fc42323..39422f283b8fbec9c636df4bf268981ac37419b0 100644 (file)
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
-          <argLine>${webdav.argLine}</argLine>
+          <argLine>${webdav.argLine} ${jacocoagent}</argLine>
           <systemPropertyVariables>
             <appserver.base>${project.build.directory}/appserver-base</appserver.base>
             <plexus.home>${project.build.directory}/appserver-base</plexus.home>
diff --git a/pom.xml b/pom.xml
index f61f0c186c0205a126eae594aedf715f9f0cca18..a4fa3b7b8b4e247fbed1fb4064b714790e0183c5 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -80,7 +80,7 @@
     <javax.jcr.version>2.0</javax.jcr.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
-
+    <jacocoagent></jacocoagent>
     <lucene.version>3.6.2</lucene.version>
     <jackrabbit.version>2.8.0</jackrabbit.version>
 
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
           <configuration>
+            <argLine>${jacocoagent}</argLine>
             <redirectTestOutputToFile>${surefire.redirectTestOutputToFile}</redirectTestOutputToFile>
             <runOrder>alphabetical</runOrder>
             <systemPropertyVariables>
         <module>archiva-modules/archiva-web/archiva-webapp-test</module>
       </modules>
     </profile>
-
+    <profile>
+      <id>jacoco-coverage</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.jacoco</groupId>
+            <artifactId>jacoco-maven-plugin</artifactId>
+            <version>0.7.2.201409121644</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>prepare-agent</goal>
+                </goals>
+                <configuration>
+                  <propertyName>jacocoproperty</propertyName>
+                </configuration>
+              </execution>
+              <execution>
+                <id>report</id>
+                <phase>prepare-package</phase>
+                <goals>
+                  <goal>report</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+      <properties>
+        <jacocoagent>${jacocoproperty}</jacocoagent>
+      </properties>
+    </profile>
   </profiles>
 
   <repositories>