Merge "Decouple configuration from application"
[cps.git] / cps-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5     <parent>
6         <groupId>org.onap.oparent</groupId>
7         <artifactId>oparent</artifactId>
8         <version>3.1.0</version>
9         <relativePath/>
10     </parent>
11     <modelVersion>4.0.0</modelVersion>
12
13     <groupId>org.onap.cps</groupId>
14     <artifactId>cps-parent</artifactId>
15     <version>0.0.1-SNAPSHOT</version>
16     <packaging>pom</packaging>
17
18     <properties>
19         <app>org.onap.cps.Application</app>
20         <base.image>openjdk:11-jre-slim</base.image>
21         <java.version>11</java.version>
22         <jib-maven-plugin.version>2.6.0</jib-maven-plugin.version>
23         <minimum-coverage>0.9</minimum-coverage>
24         <nexusproxy>https://nexus.onap.org</nexusproxy>
25         <oparent.version>3.1.0</oparent.version>
26         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
27         <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
28         <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
29         <spotbugs-maven-plugin.version>4.1.3</spotbugs-maven-plugin.version>
30         <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
31         <spotbugs.slf4j.version>1.8.0-beta4</spotbugs.slf4j.version>
32         <spotbugs.bug-pattern.version>1.5.0</spotbugs.bug-pattern.version>
33         <spotbugs.version>4.2.0</spotbugs.version>
34         <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
35         <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
36         <image.version>${project.version}</image.version>
37
38         <jacoco.reportDirectory.aggregate>${project.reporting.outputDirectory}/jacoco-aggregate</jacoco.reportDirectory.aggregate>
39         <sonar.coverage.jacoco.xmlReportPaths>
40             ../cps-ri/target/site/jacoco-ut/jacoco.xml,
41             ../cps-ri/target/site/jacoco-aggregate/jacoco.xml,
42             ../cps-service/target/site/jacoco-ut/jacoco.xml,
43             ../cps-service/target/site/jacoco-aggregate/jacoco.xml,
44             ../cps-rest/target/site/jacoco-ut/jacoco.xml,
45             ../cps-rest/target/site/jacoco-aggregate/jacoco.xml,
46             ../cps-nf-proxy-rest/target/site/jacoco-ut/jacoco.xml,
47             ../cps-nf-proxy-rest/target/site/jacoco-aggregate/jacoco.xml,
48             ../cps-application/target/site/jacoco-ut/jacoco.xml,
49             ../cps-application/target/site/jacoco-aggregate/jacoco.xml
50         </sonar.coverage.jacoco.xmlReportPaths>
51     </properties>
52
53     <distributionManagement>
54         <repository>
55             <id>ecomp-releases</id>
56             <name>ECOMP Release Repository</name>
57             <url>${nexusproxy}${releaseNexusPath}</url>
58         </repository>
59         <snapshotRepository>
60             <id>ecomp-snapshots</id>
61             <name>ECOMP Snapshot Repository</name>
62             <url>${nexusproxy}${snapshotNexusPath}</url>
63         </snapshotRepository>
64     </distributionManagement>
65
66     <dependencyManagement>
67         <dependencies>
68             <dependency>
69                 <groupId>org.onap.cps</groupId>
70                 <artifactId>cps-dependencies</artifactId>
71                 <version>${project.version}</version>
72                 <type>pom</type>
73                 <scope>import</scope>
74             </dependency>
75             <dependency>
76                 <groupId>org.onap.cps</groupId>
77                 <artifactId>cps-bom</artifactId>
78                 <version>${project.version}</version>
79                 <type>pom</type>
80                 <scope>import</scope>
81             </dependency>
82         </dependencies>
83     </dependencyManagement>
84
85     <build>
86         <resources>
87             <resource>
88                 <directory>src/main/resources</directory>
89                 <filtering>true</filtering>
90             </resource>
91             <resource>
92                 <directory>target/generated-sources/license</directory>
93                 <includes>
94                     <include>third-party-licenses.txt</include>
95                 </includes>
96             </resource>
97             <resource>
98                 <directory>target/generated-resources/licenses</directory>
99                 <includes>
100                     <include>*.*</include>
101                 </includes>
102                 <targetPath>third-party-licenses</targetPath>
103             </resource>
104         </resources>
105         <pluginManagement>
106             <plugins>
107                 <plugin>
108                     <groupId>org.springframework.boot</groupId>
109                     <artifactId>spring-boot-maven-plugin</artifactId>
110                     <version>${spring-boot-maven-plugin.version}</version>
111                     <executions>
112                         <execution>
113                             <goals>
114                                 <goal>build-info</goal>
115                                 <goal>repackage</goal>
116                             </goals>
117                         </execution>
118                     </executions>
119                 </plugin>
120                 <!-- Swagger code generation. -->
121                 <plugin>
122                     <groupId>io.swagger.codegen.v3</groupId>
123                     <artifactId>swagger-codegen-maven-plugin</artifactId>
124                     <version>${swagger-codegen-maven-plugin.version}</version>
125                 </plugin>
126                 <plugin>
127                     <groupId>com.google.cloud.tools</groupId>
128                     <artifactId>jib-maven-plugin</artifactId>
129                     <version>${jib-maven-plugin.version}</version>
130                     <configuration>
131                         <container>
132                             <mainClass>${app}</mainClass>
133                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
134                         </container>
135                         <from>
136                             <image>${base.image}</image>
137                         </from>
138                         <to>
139                             <image>${repository.name}:${image.version}</image>
140                         </to>
141                     </configuration>
142                 </plugin>
143                 <plugin>
144                     <groupId>com.github.spotbugs</groupId>
145                     <artifactId>spotbugs-maven-plugin</artifactId>
146                     <version>${spotbugs-maven-plugin.version}</version>
147                     <dependencies>
148                         <dependency>
149                             <groupId>com.github.spotbugs</groupId>
150                             <artifactId>spotbugs</artifactId>
151                             <version>${spotbugs.version}</version>
152                         </dependency>
153                         <dependency>
154                             <groupId>${project.groupId}</groupId>
155                             <artifactId>spotbugs</artifactId>
156                             <version>${project.version}</version>
157                         </dependency>
158                         <dependency>
159                             <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 -->
160                             <groupId>org.slf4j</groupId>
161                             <artifactId>slf4j-simple</artifactId>
162                             <version>${spotbugs.slf4j.version}</version>
163                         </dependency>
164                     </dependencies>
165                     <configuration>
166                         <plugins>
167                             <plugin>
168                                 <groupId>jp.skypencil.findbugs.slf4j</groupId>
169                                 <artifactId>bug-pattern</artifactId>
170                                 <version>1.5.0</version>
171                             </plugin>
172                         </plugins>
173                         <!--
174                           Enables analysis which takes more memory but finds more bugs.
175                           If you run out of memory, changes the value of the effort element
176                           to 'Low'.
177                         -->
178                         <effort>Max</effort>
179                         <!-- Reports all bugs (other values are medium and max) -->
180                         <threshold>Low</threshold>
181                         <!-- Build doesn't fail if problems are found -->
182                         <failOnError>true</failOnError>
183                         <!-- References the excluded rules -->
184                         <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
185                         <!-- Produces XML report -->
186                         <xmlOutput>true</xmlOutput>
187                         <!-- Configures the directory in which the XML report is created -->
188                         <xmlOutputDirectory>${project.build.directory}/spotbugs</xmlOutputDirectory>
189                     </configuration>
190                     <executions>
191                         <!--
192                           Ensures that SpotBugs inspects source code when project is compiled.
193                         -->
194                         <execution>
195                             <id>analyze-compile</id>
196                             <phase>compile</phase>
197                             <goals>
198                                 <goal>check</goal>
199                             </goals>
200                         </execution>
201                     </executions>
202                 </plugin>
203             </plugins>
204         </pluginManagement>
205         <plugins>
206             <plugin>
207                 <groupId>org.apache.maven.plugins</groupId>
208                 <artifactId>maven-compiler-plugin</artifactId>
209                 <configuration>
210                     <source>${java.version}</source>
211                     <target>${java.version}</target>
212                 </configuration>
213             </plugin>
214             <plugin>
215                 <groupId>org.apache.maven.plugins</groupId>
216                 <artifactId>maven-checkstyle-plugin</artifactId>
217                 <executions>
218                     <execution>
219                         <id>onap-license</id>
220                         <goals>
221                             <goal>check</goal>
222                         </goals>
223                         <phase>process-sources</phase>
224                         <configuration>
225                             <configLocation>onap-checkstyle/check-license.xml</configLocation>
226                             <includeResources>false</includeResources>
227                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
228                             <includeTestResources>false</includeTestResources>
229                             <sourceDirectories>
230                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
231                             </sourceDirectories>
232                             <consoleOutput>false</consoleOutput>
233                             <violationSeverity>warning</violationSeverity>
234                             <failOnViolation>true</failOnViolation>
235                         </configuration>
236                     </execution>
237                     <execution>
238                         <id>onap-java-style</id>
239                         <goals>
240                             <goal>check</goal>
241                         </goals>
242                         <phase>process-sources</phase>
243                         <configuration>
244                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
245                             <sourceDirectories>
246                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
247                             </sourceDirectories>
248                             <includeResources>true</includeResources>
249                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
250                             <includeTestResources>true</includeTestResources>
251                             <consoleOutput>false</consoleOutput>
252                             <violationSeverity>warning</violationSeverity>
253                             <failOnViolation>true</failOnViolation>
254                         </configuration>
255                     </execution>
256                     <execution>
257                         <id>cps-java-style</id>
258                         <goals>
259                             <goal>check</goal>
260                         </goals>
261                         <phase>process-sources</phase>
262                         <configuration>
263                             <configLocation>cps-java-style.xml</configLocation>
264                             <sourceDirectories>
265                                 <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
266                             </sourceDirectories>
267                             <includeResources>true</includeResources>
268                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
269                             <includeTestResources>true</includeTestResources>
270                             <consoleOutput>true</consoleOutput>
271                             <violationSeverity>warning</violationSeverity>
272                             <failOnViolation>true</failOnViolation>
273                         </configuration>
274                     </execution>
275                 </executions>
276                 <dependencies>
277                     <dependency>
278                         <groupId>org.onap.oparent</groupId>
279                         <artifactId>checkstyle</artifactId>
280                         <version>${oparent.version}</version>
281                     </dependency>
282                     <dependency>
283                         <groupId>${project.groupId}</groupId>
284                         <artifactId>checkstyle</artifactId>
285                         <version>${project.version}</version>
286                     </dependency>
287                 </dependencies>
288             </plugin>
289             <!-- Mandatory plugins for using Spock -->
290             <plugin>
291                 <!-- The gmavenplus plugin is used to compile Groovy code.
292                     To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
293                 <groupId>org.codehaus.gmavenplus</groupId>
294                 <artifactId>gmavenplus-plugin</artifactId>
295                 <version>1.9.0</version>
296                 <executions>
297                     <execution>
298                         <goals>
299                             <goal>compileTests</goal>
300                         </goals>
301                     </execution>
302                 </executions>
303             </plugin>
304             <!-- Required because names of spec classes don't match default
305                 Surefire patterns (`*Test` etc.) -->
306             <plugin>
307                 <groupId>org.apache.maven.plugins</groupId>
308                 <artifactId>maven-surefire-plugin</artifactId>
309                 <configuration>
310                     <!--suppress UnresolvedMavenProperty -->
311                     <argLine>${surefireArgLine}</argLine>
312                     <useFile>false</useFile>
313                     <includes>
314                         <include>**/*Spec.java</include>
315                         <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
316                     </includes>
317                     <excludes>
318                         <exclude>**/IT*.java</exclude>
319                     </excludes>
320                     <environmentVariables>
321                         <!--
322                             disable privileged container usage to cleanup the test containers;
323                             these will be removed automatically on jvm termination;
324                             see https://www.testcontainers.org/features/configuration/#disabling-ryuk
325                          -->
326                         <TESTCONTAINERS_RYUK_DISABLED>true</TESTCONTAINERS_RYUK_DISABLED>
327                     </environmentVariables>
328                 </configuration>
329             </plugin>
330             <plugin>
331                 <groupId>org.jacoco</groupId>
332                 <artifactId>jacoco-maven-plugin</artifactId>
333                 <executions>
334                     <execution>
335                         <id>default-prepare-agent</id>
336                         <goals>
337                             <goal>prepare-agent</goal>
338                         </goals>
339                     </execution>
340                     <execution>
341                         <id>coverage-check</id>
342                         <goals>
343                             <goal>check</goal>
344                         </goals>
345                         <configuration>
346                             <excludes>
347                                 <exclude>org/onap/cps/rest/model/*</exclude>
348                             </excludes>
349                             <dataFile>${project.build.directory}/code-coverage/jacoco-ut.exec</dataFile>
350                             <rules>
351                                 <rule>
352                                     <element>BUNDLE</element>
353                                     <limits>
354                                         <limit>
355                                             <counter>INSTRUCTION</counter>
356                                             <value>COVEREDRATIO</value>
357                                             <minimum>${minimum-coverage}</minimum>
358                                         </limit>
359                                     </limits>
360                                 </rule>
361                             </rules>
362                         </configuration>
363                     </execution>
364                     <execution>
365                         <id>report</id>
366                         <goals>
367                             <goal>report-aggregate</goal>
368                         </goals>
369                         <phase>verify</phase>
370                         <configuration>
371                             <dataFileIncludes>
372                                 <fileInclude>**/code-coverage/jacoco-ut.exec</fileInclude>
373                             </dataFileIncludes>
374                         </configuration>
375                     </execution>
376                 </executions>
377             </plugin>
378             <plugin>
379                 <groupId>com.github.spotbugs</groupId>
380                 <artifactId>spotbugs-maven-plugin</artifactId>
381             </plugin>
382             <plugin>
383                 <groupId>org.sonarsource.scanner.maven</groupId>
384                 <artifactId>sonar-maven-plugin</artifactId>
385             </plugin>
386         </plugins>
387     </build>
388 </project>