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