Merge "URI is not absolute when service name is not set"
[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         <oparent.version>3.1.0</oparent.version>
24         <repository.name>nexus3.onap.org:10001/onap/cps-service</repository.name>
25         <spring-boot-maven-plugin.version>2.3.3.RELEASE</spring-boot-maven-plugin.version>
26         <swagger-codegen-maven-plugin.version>3.0.18</swagger-codegen-maven-plugin.version>
27         <tag.version>${project.version}</tag.version>
28     </properties>
29
30     <dependencyManagement>
31         <dependencies>
32             <dependency>
33                 <groupId>org.onap.cps</groupId>
34                 <artifactId>cps-dependencies</artifactId>
35                 <version>${project.version}</version>
36                 <type>pom</type>
37                 <scope>import</scope>
38             </dependency>
39             <dependency>
40                 <groupId>org.onap.cps</groupId>
41                 <artifactId>cps-bom</artifactId>
42                 <version>${project.version}</version>
43                 <type>pom</type>
44                 <scope>import</scope>
45             </dependency>
46         </dependencies>
47     </dependencyManagement>
48
49     <build>
50         <resources>
51             <resource>
52                 <directory>src/main/resources</directory>
53                 <filtering>true</filtering>
54             </resource>
55             <resource>
56                 <directory>target/generated-sources/license</directory>
57                 <includes>
58                     <include>third-party-licenses.txt</include>
59                 </includes>
60             </resource>
61             <resource>
62                 <directory>target/generated-resources/licenses</directory>
63                 <includes>
64                     <include>*.*</include>
65                 </includes>
66                 <targetPath>third-party-licenses</targetPath>
67             </resource>
68         </resources>
69         <pluginManagement>
70             <plugins>
71                 <plugin>
72                     <groupId>org.springframework.boot</groupId>
73                     <artifactId>spring-boot-maven-plugin</artifactId>
74                     <version>${spring-boot-maven-plugin.version}</version>
75                     <executions>
76                         <execution>
77                             <goals>
78                                 <goal>build-info</goal>
79                                 <goal>repackage</goal>
80                             </goals>
81                         </execution>
82                     </executions>
83                 </plugin>
84                 <!-- Swagger code generation. -->
85                 <plugin>
86                     <groupId>io.swagger.codegen.v3</groupId>
87                     <artifactId>swagger-codegen-maven-plugin</artifactId>
88                     <version>${swagger-codegen-maven-plugin.version}</version>
89                     <executions>
90                         <execution>
91                             <goals>
92                                 <goal>generate</goal>
93                             </goals>
94                             <configuration>
95                                 <inputSpec>${project.basedir}/docs/api/swagger/openapi.yml</inputSpec>
96                                 <invokerPackage>org.onap.cps.rest.controller</invokerPackage>
97                                 <modelPackage>org.onap.cps.rest.model</modelPackage>
98                                 <apiPackage>org.onap.cps.rest.api</apiPackage>
99                                 <language>spring</language>
100                                 <generateSupportingFiles>false</generateSupportingFiles>
101                                 <configOptions>
102                                     <sourceFolder>src/gen/java</sourceFolder>
103                                     <dateLibrary>java11</dateLibrary>
104                                     <interfaceOnly>true</interfaceOnly>
105                                     <useTags>true</useTags>
106                                 </configOptions>
107                             </configuration>
108                         </execution>
109                     </executions>
110                 </plugin>
111             </plugins>
112         </pluginManagement>
113         <plugins>
114             <plugin>
115                 <groupId>org.apache.maven.plugins</groupId>
116                 <artifactId>maven-compiler-plugin</artifactId>
117                 <configuration>
118                     <source>${java.version}</source>
119                     <target>${java.version}</target>
120                 </configuration>
121             </plugin>
122             <plugin>
123                 <groupId>org.apache.maven.plugins</groupId>
124                 <artifactId>maven-checkstyle-plugin</artifactId>
125                 <executions>
126                     <execution>
127                         <id>onap-java-style</id>
128                         <goals>
129                             <goal>check</goal>
130                         </goals>
131                         <phase>process-sources</phase>
132                         <configuration>
133                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
134                             <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
135                             <includeResources>true</includeResources>
136                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
137                             <includeTestResources>true</includeTestResources>
138                             <consoleOutput>false</consoleOutput>
139                             <violationSeverity>warning</violationSeverity>
140                             <failOnViolation>true</failOnViolation>
141                         </configuration>
142                     </execution>
143                 </executions>
144                 <dependencies>
145                     <dependency>
146                         <groupId>org.onap.oparent</groupId>
147                         <artifactId>checkstyle</artifactId>
148                         <version>${oparent.version}</version>
149                     </dependency>
150                 </dependencies>
151             </plugin>
152             <!-- Mandatory plugins for using Spock -->
153             <plugin>
154                 <!-- The gmavenplus plugin is used to compile Groovy code.
155                     To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
156                 <groupId>org.codehaus.gmavenplus</groupId>
157                 <artifactId>gmavenplus-plugin</artifactId>
158                 <version>1.9.0</version>
159                 <executions>
160                     <execution>
161                         <goals>
162                             <goal>compileTests</goal>
163                         </goals>
164                     </execution>
165                 </executions>
166             </plugin>
167             <!-- Required because names of spec classes don't match default
168                 Surefire patterns (`*Test` etc.) -->
169             <plugin>
170                 <groupId>org.apache.maven.plugins</groupId>
171                 <artifactId>maven-surefire-plugin</artifactId>
172                 <version>3.0.0-M5</version>
173                 <configuration>
174                     <useFile>false</useFile>
175                     <includes>
176                         <include>**/*Spec.java</include>
177                         <include>**/*Test.java</include> <!-- Just in case of having also "normal" JUnit tests -->
178                     </includes>
179                 </configuration>
180             </plugin>
181             <plugin>
182                 <groupId>com.google.cloud.tools</groupId>
183                 <artifactId>jib-maven-plugin</artifactId>
184                 <version>${jib-maven-plugin.version}</version>
185                 <configuration>
186                     <container>
187                         <mainClass>${app}</mainClass>
188                         <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
189                     </container>
190                     <from>
191                         <image>${base.image}</image>
192                     </from>
193                     <to>
194                         <image>${repository.name}</image>
195                         <tags>
196                             <tag>${tag.version}</tag>
197                         </tags>
198                     </to>
199                 </configuration>
200                 <executions>
201                     <execution>
202                         <phase>package</phase>
203                         <id>build</id>
204                         <goals>
205                             <goal>dockerBuild</goal>
206                         </goals>
207                     </execution>
208                     <execution>
209                         <phase>deploy</phase>
210                         <id>buildAndPush</id>
211                         <goals>
212                             <goal>build</goal>
213                         </goals>
214                     </execution>
215                 </executions>
216             </plugin>
217         </plugins>
218     </build>
219 </project>