Add Sonar configuration and plug in
[dmaap/messagerouter/dmaapclient.git] / pom.xml
1 <!--
2      ============LICENSE_START=======================================================
3      org.onap.dmaap
4      ================================================================================
5      Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6      ================================================================================
7      Licensed under the Apache License, Version 2.0 (the "License");
8      you may not use this file except in compliance with the License.
9      You may obtain a copy of the License at
10            http://www.apache.org/licenses/LICENSE-2.0
11      
12      Unless required by applicable law or agreed to in writing, software
13      distributed under the License is distributed on an "AS IS" BASIS,
14      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15      See the License for the specific language governing permissions and
16      limitations under the License.
17      ============LICENSE_END=========================================================
18    
19      ECOMP is a trademark and service mark of AT&T Intellectual Property.
20      
21  -->
22 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
24         <modelVersion>4.0.0</modelVersion>
25         <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
26         <artifactId>dmaapClient</artifactId>
27         <packaging>jar</packaging>
28         <version>1.0.0-SNAPSHOT</version>
29         <name>dmaapClient</name>
30         <description>Client library for MR event routing API</description>
31         <url>https://github.com/att/dmaap-framework</url>
32
33         <parent>
34                 <groupId>org.onap.oparent</groupId>
35                 <artifactId>oparent</artifactId>
36                 <version>1.0.0-SNAPSHOT</version>
37         </parent>
38         <properties>
39                 <!-- for the client library, we want to allow 1.6 or later -->
40                 <maven.compiler.target>1.7</maven.compiler.target>
41                 <maven.compiler.source>1.7</maven.compiler.source>
42                 <jersey.version>2.22.1</jersey.version>
43                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44                 
45                 <!--  SONAR  -->
46                  <jacoco.version>0.7.7.201606060606</jacoco.version>
47             <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
48             <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
49             <!-- Default Sonar configuration -->
50             <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
51             <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
52             <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
53             <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
54         </properties>
55
56          <licenses>
57           <license>
58             <name>Apache License Version 2.0</name>
59           </license>
60         </licenses>
61
62         <developers>
63            <developer>
64              <name>Rajashree</name>
65              <email></email>
66              <organization>ATT</organization>
67              <organizationUrl>www.att.com</organizationUrl>
68            </developer>
69            <developer>
70              <name>Ramkumar</name>
71              <email></email>
72              <organization>ATT</organization>
73              <organizationUrl>www.att.com</organizationUrl>
74            </developer>
75          </developers>
76
77         <dependencies>
78                 <dependency>
79                         <groupId>com.att.nsa</groupId>
80                         <artifactId>saClientLibrary</artifactId>
81                         <version>0.0.1</version>
82                 </dependency>
83
84                 <dependency>
85                         <groupId>org.json</groupId>
86                         <artifactId>json</artifactId>
87                         <version>20131018</version>
88                 </dependency>
89
90                 <dependency>
91                         <groupId>com.att.aft</groupId>
92                         <artifactId>dme2</artifactId>
93                         <version>3.1.200</version>
94                         <exclusions>
95                                 <exclusion>
96                                         <groupId>com.sun.jersey</groupId>
97                                         <artifactId>jersey-json</artifactId>
98                                 </exclusion>
99                                 <exclusion>
100                                         <groupId>com.sun.jersey</groupId>
101                                         <artifactId>jersey-client</artifactId>
102                                 </exclusion>
103                         </exclusions>
104                 </dependency>
105                 <!-- Begin - Dependency on log4j for logging purpose -->
106                 <dependency>
107                         <groupId>log4j</groupId>
108                         <artifactId>log4j</artifactId>
109                         <version>1.2.17</version>
110                 </dependency>
111                 <!-- Log4j's enhanced pattern layout is shipped separately -->
112                 <dependency>
113                         <groupId>log4j</groupId>
114                         <artifactId>apache-log4j-extras</artifactId>
115                         <version>1.2.17</version>
116                 </dependency>
117                 <!-- End - Dependency on log4j for logging purpose -->
118
119                 <dependency>
120                         <groupId>javax.ws.rs</groupId>
121                         <artifactId>javax.ws.rs-api</artifactId>
122                         <version>2.0.1</version>
123                 </dependency>
124
125                 <dependency>
126                         <groupId>org.glassfish.jersey.core</groupId>
127                         <artifactId>jersey-common</artifactId>
128                         <version>${jersey.version}</version>
129                 </dependency>
130
131                 <dependency>
132                         <groupId>org.glassfish.jersey.core</groupId>
133                         <artifactId>jersey-client</artifactId>
134                         <version>${jersey.version}</version>
135                 </dependency>
136
137                 <dependency>
138                         <groupId>org.glassfish.jersey.media</groupId>
139                         <artifactId>jersey-media-json-jackson</artifactId>
140                         <version>${jersey.version}</version>
141                 </dependency>
142                 <dependency>
143                         <groupId>junit</groupId>
144                         <artifactId>junit</artifactId>
145                         <version>4.11</version>
146                         <scope>test</scope>
147                 </dependency>
148         </dependencies>
149
150         <build>
151                 <resources>
152                         <resource>
153                                 <directory>src/main/resources</directory>
154                                 <filtering>true</filtering>
155                                 <includes>
156                                         <include>**/MRClientVersion.properties</include>
157                                 </includes>
158                         </resource>
159                         <resource>
160                                 <directory>src/main/resources</directory>
161                                 <filtering>false</filtering>
162                                 <excludes>
163                                         <exclude>**/MRClientVersion.properties</exclude>
164                                 </excludes>
165                         </resource>
166                 </resources>
167                 <plugins>
168                         <plugin>
169                                 <artifactId>maven-assembly-plugin</artifactId>
170                                 <version>2.4</version>
171                                 <configuration>
172                                         <descriptorRefs>
173                                                 <descriptorRef>jar-with-dependencies</descriptorRef>
174                                         </descriptorRefs>
175                                 </configuration>
176
177                                 <executions>
178                                         <execution>
179                                                 <id>make-assembly</id> <!-- this is used for inheritance merges -->
180                                                 <phase>package</phase> <!-- bind to the packaging phase -->
181                                                 <goals>
182                                                         <goal>single</goal>
183                                                 </goals>
184                                         </execution>
185                                 </executions>
186                         </plugin>
187
188
189                         <plugin>
190                                 <groupId>org.apache.maven.plugins</groupId>
191                                 <artifactId>maven-javadoc-plugin</artifactId>
192                                 <version>2.10.4</version>
193                                 <configuration>
194                                         <additionalparam>-Xdoclint:none</additionalparam>
195                                 </configuration>
196                                 <executions>
197                                         <execution>
198                                                 <id>attach-javadocs</id>
199                                                 <goals>
200                                                         <goal>jar</goal>
201                                                 </goals>
202                                         </execution>
203                                 </executions>
204                         </plugin>
205                         <plugin>
206                                 <groupId>org.apache.maven.plugins</groupId>
207                                 <artifactId>maven-source-plugin</artifactId>
208                                 <version>3.0.0</version>
209                                 <executions>
210                                         <execution>
211                                                 <id>attach-sources</id>
212                                                 <goals>
213                                                         <goal>jar-no-fork</goal>
214                                                 </goals>
215                                         </execution>
216                                 </executions>
217                         </plugin>
218                         <plugin>
219                                 <artifactId>maven-compiler-plugin</artifactId>
220                                 <version>3.1</version>
221                                 <configuration>
222                                         <source>1.7</source>
223                                         <target>1.7</target>
224                                 </configuration>
225                         </plugin>
226                           <plugin>
227           <groupId>org.jacoco</groupId>
228           <artifactId>jacoco-maven-plugin</artifactId>
229           <version>${jacoco.version}</version>
230           <configuration>
231             <!-- Note: This exclusion list should match <sonar.exclusions>
232          property above -->
233             <excludes>
234               <exclude>**/gen/**</exclude>
235               <exclude>**/generated-sources/**</exclude>
236               <exclude>**/yang-gen/**</exclude>
237               <exclude>**/pax/**</exclude>
238             </excludes>
239           </configuration>
240           <executions>
241             <!--
242         Prepares the property pointing to the JaCoCo runtime agent which
243         is passed as VM argument when Maven the Surefire plugin is executed.
244         -->
245             <execution>
246               <id>pre-unit-test</id>
247               <goals>
248                 <goal>prepare-agent</goal>
249               </goals>
250               <configuration>
251                 <!-- Sets the path to the file which contains the execution data. -->
252                 <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
253                 <!--
254             Sets the name of the property containing the settings
255             for JaCoCo runtime agent.
256         -->
257                 <propertyName>surefireArgLine</propertyName>
258               </configuration>
259             </execution>
260             <!--
261         Ensures that the code coverage report for unit tests is created after
262         unit tests have been run.
263         -->
264             <execution>
265               <id>post-unit-test</id>
266               <phase>test</phase>
267               <goals>
268                 <goal>report</goal>
269               </goals>
270               <configuration>
271                 <!-- Sets the path to the file which contains the execution data. -->
272                 <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
273                 <!-- Sets the output directory for the code coverage report. -->
274                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
275               </configuration>
276             </execution>
277             <execution>
278               <id>pre-integration-test</id>
279               <phase>pre-integration-test</phase>
280               <goals>
281                 <goal>prepare-agent</goal>
282               </goals>
283               <configuration>
284                 <!-- Sets the path to the file which contains the execution data. -->
285                 <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
286                 <!--
287             Sets the name of the property containing the settings
288             for JaCoCo runtime agent.
289         -->
290                 <propertyName>failsafeArgLine</propertyName>
291               </configuration>
292             </execution>
293             <!--
294         Ensures that the code coverage report for integration tests after
295         integration tests have been run.
296         -->
297             <execution>
298               <id>post-integration-test</id>
299               <phase>post-integration-test</phase>
300               <goals>
301                 <goal>report</goal>
302               </goals>
303               <configuration>
304                 <!-- Sets the path to the file which contains the execution data. -->
305                 <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
306                 <!-- Sets the output directory for the code coverage report. -->
307                 <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
308               </configuration>
309             </execution>
310           </executions>
311         </plugin>
312                 </plugins>
313         </build>
314
315         <profiles>
316                 <!-- Add plugins here that should only be executed on the Jenkins server -->
317                 <profile>
318                         <id>jenkins</id>
319                         <activation>
320                                 <property>
321                                         <name>env.BUILD_NUMBER</name>
322                                 </property>
323                         </activation>
324                         <build>
325                                 <plugins>
326                                         <plugin>
327                                                 <groupId>org.codehaus.mojo</groupId>
328                                                 <artifactId>cobertura-maven-plugin</artifactId>
329                                         </plugin>
330                                 </plugins>
331                         </build>
332                 </profile>
333         </profiles>
334 </project>