Update Sonar/JaCoCo integration
[odlparent.git] / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- vi: set et smarttab sw=4 tabstop=4: --><!--
3  Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
4
5  This program and the accompanying materials are made available under the
6  terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  and is available at http://www.eclipse.org/legal/epl-v10.html
8 --><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">
9     <modelVersion>4.0.0</modelVersion>
10
11     <parent>
12         <groupId>org.opendaylight.odlparent</groupId>
13         <artifactId>odlparent-lite</artifactId>
14         <version>7.0.0-SNAPSHOT</version>
15         <relativePath>odlparent-lite</relativePath>
16     </parent>
17
18     <artifactId>odlparent-aggregator</artifactId>
19     <name>odlparent</name> <!-- Used by Sonar to set project name -->
20     <packaging>pom</packaging>
21
22     <scm>
23         <connection>scm:git:ssh://git.opendaylight.org:29418/odlparent.git</connection>
24         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/odlparent.git</developerConnection>
25         <tag>HEAD</tag>
26         <url>https://wiki.opendaylight.org/view/ODL_Root_Parent:Main</url>
27     </scm>
28
29     <properties>
30         <maven.deploy.skip>true</maven.deploy.skip>
31         <maven.install.skip>true</maven.install.skip>
32     </properties>
33
34     <modules>
35         <!-- odlparent tools -->
36         <module>checkstyle</module>
37         <module>spotbugs</module>
38         <module>license</module>
39
40         <!-- Features test (SFT) -->
41         <module>bundles-test-lib</module>
42         <module>bundles4-test</module>
43         <module>features-test</module>
44
45         <!-- Karaf integration -->
46         <module>karaf</module>
47         <module>karaf-plugin</module>
48         <module>karaf-util</module>
49
50         <!-- Parent POMs -->
51         <module>bundle-parent</module>
52         <module>untested-single-feature-parent</module>
53         <module>single-feature-parent</module>
54         <module>feature-repo-parent</module>
55         <module>odlparent</module>
56         <module>odlparent-lite</module>
57
58         <!-- Manifest filtering plugin -->
59         <module>filter-manifest-plugin</module>
60
61         <!-- Features -->
62         <module>features</module>
63
64         <!-- Artifacts -->
65         <module>odlparent-artifacts</module>
66
67         <!-- Aggragated javadocs -->
68         <module>docs</module>
69
70         <!-- Self-tests -->
71         <module>odlparent-bundle-check</module>
72         <module>odlparent-dependency-check</module>
73         <module>tests</module>
74     </modules>
75
76     <profiles>
77         <profile>
78             <!--
79                 This profile is to ensure we only build javadocs reports
80                 when we plan to deploy Maven site for our project.
81             -->
82             <id>maven-site</id>
83             <activation>
84                 <file>
85                     <exists>${user.dir}/deploy-site.xml</exists>
86                 </file>
87             </activation>
88
89             <build>
90                 <plugins>
91                     <plugin>
92                         <artifactId>maven-javadoc-plugin</artifactId>
93                         <version>3.0.1</version>
94                         <inherited>false</inherited>
95                         <executions>
96                             <execution>
97                                 <id>aggregate</id>
98                                 <goals>
99                                     <goal>aggregate</goal>
100                                 </goals>
101                                 <phase>package</phase>
102                             </execution>
103                         </executions>
104                     </plugin>
105                 </plugins>
106             </build>
107         </profile>
108         <profile>
109             <id>sonar-jacoco-aggregate</id>
110             <activation>
111                 <property>
112                     <name>odl.jacoco.aggregateFile</name>
113                 </property>
114             </activation>
115             <build>
116                 <plugins>
117                     <plugin>
118                         <groupId>org.jacoco</groupId>
119                         <artifactId>jacoco-maven-plugin</artifactId>
120                         <executions>
121                             <execution>
122                                 <!-- Step one:
123
124                                     merge all .exec files into a single file into this project's
125                                     ${project.build.directory}/jacoco.exec. Note we are being explicit so as
126                                     to override the odlparent/pom.xml override
127                                 -->
128                                 <id>merge</id>
129                                 <goals>
130                                     <goal>merge</goal>
131                                 </goals>
132                                 <phase>generate-resources</phase>
133                                 <configuration>
134                                     <destFile>${odl.jacoco.aggregateFile}</destFile>
135                                     <fileSets>
136                                         <fileSet>
137                                             <directory>${project.basedir}</directory>
138                                             <includes>
139                                                 <include>**/target/code-coverage/*.exec</include>
140                                             </includes>
141                                         </fileSet>
142                                     </fileSets>
143                                 </configuration>
144                             </execution>
145                             <execution>
146                                 <!-- Step two:
147
148                                     pick the merged execution file and produce a complete aggregate report,
149                                     including HTML/XML/CSV.
150                                  -->
151                                 <id>report</id>
152                                 <goals>
153                                     <goal>report-aggregate</goal>
154                                 </goals>
155                                 <phase>generate-resources</phase>
156                                 <configuration>
157                                     <dataFileIncludes>${odl.jacoco.aggregateFile}</dataFileIncludes>
158                                 </configuration>
159                             </execution>
160                         </executions>
161                     </plugin>
162                 </plugins>
163             </build>
164         </profile>
165     </profiles>
166
167 </project>