Activate jacoco aggregation on odl.jacoco.aggregateFile 75/76075/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 13 Sep 2018 21:58:29 +0000 (23:58 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 13 Sep 2018 21:58:29 +0000 (23:58 +0200)
Unless this property is defined, we don't really have a user,
which means we should not be aggragating jacoco.

Change-Id: I2e9c72d1a30b531111089e14c1fc99ffebb4da28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
pom.xml

diff --git a/pom.xml b/pom.xml
index 7091e9f7e6045c46decb181f2510a4bd51de2d9d..0f4dbc0cf31cd3c127ce8d2519c7addbef2b8c60 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <module>third-party</module>
     </modules>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.jacoco</groupId>
-                <artifactId>jacoco-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>merge</id>
-                        <goals>
-                            <goal>merge</goal>
-                        </goals>
-                        <phase>generate-resources</phase>
-                        <configuration>
-                            <fileSets>
-                                <fileSet>
-                                    <directory>${project.basedir}</directory>
-                                    <includes>
-                                        <include>**/target/code-coverage/*.exec</include>
-                                    </includes>
-                                </fileSet>
-                            </fileSets>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
     <profiles>
-      <profile>
-        <!--
-            This profile is to ensure we only build javadocs reports
-            when we plan to deploy Maven site for our project.
-        -->
-        <id>maven-site</id>
-        <activation>
-          <file>
-            <exists>${user.dir}/deploy-site.xml</exists>
-          </file>
-        </activation>
+        <profile>
+            <id>sonar-jacoco-aggregate</id>
+            <activation>
+
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.jacoco</groupId>
+                        <artifactId>jacoco-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>merge</id>
+                                <goals>
+                                    <goal>merge</goal>
+                                </goals>
+                                <phase>generate-resources</phase>
+                                <configuration>
+                                    <destFile>${odl.jacoco.aggregateFile}</destFile>
+                                    <fileSets>
+                                        <fileSet>
+                                            <directory>${project.basedir}</directory>
+                                            <includes>
+                                                <include>**/target/code-coverage/*.exec</include>
+                                            </includes>
+                                        </fileSet>
+                                    </fileSets>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <!--
+                This profile is to ensure we only build javadocs reports
+                when we plan to deploy Maven site for our project.
+            -->
+            <id>maven-site</id>
+            <activation>
+                <file>
+                    <exists>${user.dir}/deploy-site.xml</exists>
+                </file>
+            </activation>
 
-        <build>
-          <plugins>
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-javadoc-plugin</artifactId>
-              <inherited>false</inherited>
-              <executions>
-                <execution>
-                  <id>aggregate</id>
-                  <goals>
-                    <goal>aggregate</goal>
-                  </goals>
-                  <phase>package</phase>
-                  <configuration>
-                    <!-- Xerces-J has non-compliant javadocs -->
-                    <additionalparam>-Xdoclint:none</additionalparam>
-                  </configuration>
-              </execution>
-              </executions>
-            </plugin>
-          </plugins>
-        </build>
-      </profile>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <inherited>false</inherited>
+                        <executions>
+                            <execution>
+                                <id>aggregate</id>
+                                <goals>
+                                    <goal>aggregate</goal>
+                                </goals>
+                                <phase>package</phase>
+                                <configuration>
+                                    <!-- Xerces-J has non-compliant javadocs -->
+                                    <additionalparam>-Xdoclint:none</additionalparam>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
 </project>