Update SONAR config
[aai/sparky-be.git] / pom.xml
1 <?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"
3     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4     <modelVersion>4.0.0</modelVersion>
5         
6     <parent>
7         <groupId>org.onap.oparent</groupId>
8         <artifactId>oparent</artifactId>
9         <version>2.0.0</version>
10     </parent>
11     
12     <groupId>org.onap.aai</groupId>
13     <artifactId>sparky-be</artifactId>
14     <version>1.6.1-SNAPSHOT</version>
15     <packaging>pom</packaging>
16     <name>aai-sparky-be</name>
17
18         <modules>
19                 <module>sparkybe-onap-service/pom.xml</module>
20                 <module>sparkybe-onap-application/pom.xml</module>
21         </modules>
22
23     <properties>
24         <sitePath>/content/sites/site/org/onap/aai/sparky-be/${project.artifactId}/${project.version}</sitePath>
25         <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
26
27         <sonar.jacoco.reportPath />
28         <sonar.jacoco.itReportPath />
29         <sonar.jacoco.reportMissing.force.zero />
30
31         <jacoco.line.coverage.limit>0.90</jacoco.line.coverage.limit>
32         <jacoco.version>0.8.5</jacoco.version>
33         <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
34         <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
35         <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
36         <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
37
38         <sonar.scanner.version>3.7.0.1746</sonar.scanner.version>
39
40     </properties>
41
42     <!-- we don't need to deploy the top level pom project -->
43         <build>
44           <pluginManagement>
45             <plugins>
46                 <plugin>
47                     <groupId>org.apache.maven.plugins</groupId>
48                     <artifactId>maven-deploy-plugin</artifactId>
49                 </plugin>
50                 </plugins>
51               </pluginManagement>
52
53               <!-- once we connect aai-parent or oparent 3.0+ we can take out this
54                    whole section -->
55               <plugins>
56               <plugin>
57                 <groupId>org.jacoco</groupId>
58                 <artifactId>jacoco-maven-plugin</artifactId>
59                 <version>${jacoco.version}</version>
60                 <configuration>
61                   <!-- Note: This exclusion list should match <sonar.exclusions> property
62                        above -->
63                   <excludes>
64                     <exclude>**/gen/**</exclude>
65                     <exclude>**/generated-sources/**</exclude>
66                     <exclude>**/yang-gen/**</exclude>
67                     <exclude>**/pax/**</exclude>
68                     <exclude>org/onap/aai/babel/xml/generator/xsd/*</exclude>
69                   </excludes>
70                 </configuration>
71                 <executions>
72                   <!-- Prepares the property pointing to the JaCoCo runtime agent which
73                        is passed as VM argument when Maven the Surefire plugin is executed. -->
74                   <execution>
75                     <id>pre-unit-test</id>
76                     <goals>
77                       <goal>prepare-agent</goal>
78                     </goals>
79                     <configuration>
80                       <!-- Sets the path to the file which contains the execution data
81                            . -->
82                       <destFile>${project.build.directory}/code-coverage/jacoco-ut.exec</destFile>
83                       <!-- Sets the name of the property containing the settings for JaCoCo
84                            runtime agent. -->
85                       <propertyName>surefireArgLine</propertyName>
86                     </configuration>
87                   </execution>
88                   <!-- Ensures that the code coverage report for unit tests is created
89                        after unit tests have been run. -->
90                   <execution>
91                     <id>post-unit-test</id>
92                     <phase>test</phase>
93                     <goals>
94                       <goal>report</goal>
95                     </goals>
96                     <configuration>
97                       <!-- Sets the path to the file which contains the execution data
98                            . -->
99                       <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
100                       <!-- Sets the output directory for the code coverage report. -->
101                       <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
102                     </configuration>
103                   </execution>
104                   <execution>
105                     <id>pre-integration-test</id>
106                     <phase>pre-integration-test</phase>
107                     <goals>
108                       <goal>prepare-agent</goal>
109                     </goals>
110                     <configuration>
111                       <!-- Sets the path to the file which contains the execution data
112                            . -->
113                       <destFile>${project.build.directory}/code-coverage/jacoco-it.exec</destFile>
114                       <!-- Sets the name of the property containing the settings for JaCoCo
115                            runtime agent. -->
116                       <propertyName>failsafeArgLine</propertyName>
117                     </configuration>
118                   </execution>
119                   <!-- Ensures that the code coverage report for integration tests after
120                        integration tests have been run. -->
121                   <execution>
122                     <id>post-integration-test</id>
123                     <phase>post-integration-test</phase>
124                     <goals>
125                       <goal>report</goal>
126                     </goals>
127                     <configuration>
128                       <!-- Sets the path to the file which contains the execution data
129                            . -->
130                       <dataFile>${project.build.directory}/code-coverage/jacoco-it.exec</dataFile>
131                       <!-- Sets the output directory for the code coverage report. -->
132                       <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
133                     </configuration>
134                   </execution>
135                   <execution>
136                     <id>default-check</id>
137                     <goals>
138                       <goal>check</goal>
139                     </goals>
140                     <configuration>
141                       <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
142                       <rules>
143                         <rule implementation="org.jacoco.maven.RuleConfiguration">
144                           <element>BUNDLE</element>
145                           <limits>
146                             <limit implementation="org.jacoco.report.check.Limit">
147                               <counter>LINE</counter>
148                               <value>COVEREDRATIO</value>
149                               <minimum>${jacoco.line.coverage.limit}</minimum>
150                             </limit>
151                           </limits>
152                         </rule>
153                       </rules>
154                     </configuration>
155                   </execution>
156                 </executions>
157               </plugin>
158               <plugin>
159                 <groupId>org.apache.maven.plugins</groupId>
160                 <artifactId>maven-surefire-plugin</artifactId>
161                 <version>3.0.0-M4</version>
162                 <configuration>
163                   <!-- Sets the VM argument line used when unit tests are run. -->
164                   <argLine>${surefireArgLine}</argLine>
165                   <!-- Excludes integration tests when unit tests are run. -->
166                   <excludes>
167                     <exclude>**/IT*.java</exclude>
168                   </excludes>
169                 </configuration>
170               </plugin>
171               <plugin>
172                 <groupId>org.apache.maven.plugins</groupId>
173                 <artifactId>maven-failsafe-plugin</artifactId>
174                 <version>3.0.0-M4</version>
175                 <executions>
176                   <!-- Ensures that both integration-test and verify goals of the Failsafe
177                        Maven plugin are executed. -->
178                   <execution>
179                     <id>integration-tests</id>
180                     <goals>
181                       <goal>integration-test</goal>
182                       <goal>verify</goal>
183                     </goals>
184                     <configuration>
185                       <!-- Sets the VM argument line used when integration tests are run. -->
186                       <argLine>${failsafeArgLine}</argLine>
187                     </configuration>
188                   </execution>
189                 </executions>
190               </plugin>
191               <plugin>
192                 <groupId>org.sonarsource.scanner.maven</groupId>
193                 <artifactId>sonar-maven-plugin</artifactId>
194                 <version>${sonar.scanner.version}</version>
195               </plugin>
196               <!-- end removable sonar config, note the additional exclusion for babel above
197               -->
198             </plugins>
199
200
201         </build>
202         
203     <distributionManagement>
204        <repository>
205           <id>ecomp-releases</id>
206           <name>ECOMP Release Repository</name>
207           <url>${onap.nexus.url}/content/repositories/releases/</url>
208        </repository>
209        <snapshotRepository>
210           <id>ecomp-snapshots</id>
211           <name>ECOMP Snapshot Repository</name>
212           <url>${onap.nexus.url}/content/repositories/snapshots/</url>
213       </snapshotRepository>
214       <site>
215         <id>ecomp-site</id>
216         <url>dav:${onap.nexus.url}${sitePath}</url>
217       </site>
218    </distributionManagement>
219
220     <repositories>
221         <repository>
222             <id>central</id>
223             <name>Maven 2 repository 2</name>
224             <url>http://repo2.maven.org/maven2/</url>
225         </repository>
226         <repository>
227             <id>ecomp-releases</id>
228             <name>ECOMP Release Repository</name>
229             <url>${onap.nexus.url}/content/repositories/releases/</url>
230         </repository>
231         <repository>
232             <id>ecomp-staging</id>
233             <name>ECOMP Staging Repository</name>
234             <url>${onap.nexus.url}/content/repositories/staging/</url>
235         </repository>
236         <repository>
237             <id>ecomp-snapshots</id>
238             <name>ECOMP Snapshot Repository</name>
239             <url>${onap.nexus.url}/content/repositories/snapshots/</url>
240         </repository>
241     </repositories>
242         
243 </project>