Adjust docker versions and names
[oom/platform/cert-service.git] / certService / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     ================================================================================
4         Copyright (c) 2020 Nokia. All rights reserved.
5         ================================================================================
6         Licensed under the Apache License, Version 2.0 (the "License"); you may not
7         use this file except in compliance with the License. You may obtain a copy
8         of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
9         by applicable law or agreed to in writing, software distributed under the
10         License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
11         OF ANY KIND, either express or implied. See the License for the specific
12         language governing permissions and limitations under the License.
13         ============LICENSE_END=========================================================
14 -->
15 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
16          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
17     <modelVersion>4.0.0</modelVersion>
18     <parent>
19         <groupId>org.onap.aaf.certservice</groupId>
20         <artifactId>aaf-certservice</artifactId>
21         <version>1.0.0-SNAPSHOT</version>
22     </parent>
23     <artifactId>aaf-certservice-api</artifactId>
24     <version>1.0.0-SNAPSHOT</version>
25     <name>aaf-certservice-api</name>
26     <description>AAF Certification Service Api</description>
27     <packaging>jar</packaging>
28
29     <properties>
30         <java.version>11</java.version>
31         <assertj-core.version>3.11.1</assertj-core.version>
32         <mockito-core.version>3.2.4</mockito-core.version>
33         <spring-core.version>5.2.3.RELEASE</spring-core.version>
34         <spring-boot-starter.version>2.2.4.RELEASE</spring-boot-starter.version>
35         <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
36         <maven-surefire-plugin.version>3.0.0-M1</maven-surefire-plugin.version>
37         <spring-boot-starter-actuator.version>2.2.4.RELEASE</spring-boot-starter-actuator.version>
38         <spring-boot-starter-log4j2.version>2.1.5.RELEASE</spring-boot-starter-log4j2.version>
39         <springdoc-openapi-ui.version>1.2.21</springdoc-openapi-ui.version>
40         <bouncycastle.version>1.60</bouncycastle.version>
41         <docker-maven-plugin.version>0.33.0</docker-maven-plugin.version>
42         <docker.tag>${project.version}</docker.tag>
43         <springdoc-openapi-maven-plugin.apiDocsUrl>http://localhost:8080/v3/api-docs
44         </springdoc-openapi-maven-plugin.apiDocsUrl>
45         <docker-maven-plugin.image-name>onap/${project.artifactId}</docker-maven-plugin.image-name>
46         <springdoc-openapi-maven-plugin.version>0.2</springdoc-openapi-maven-plugin.version>
47     </properties>
48
49     <dependencyManagement>
50         <dependencies>
51             <dependency>
52                 <!-- Import dependency management from Spring Boot -->
53                 <groupId>org.springframework.boot</groupId>
54                 <artifactId>spring-boot-dependencies</artifactId>
55                 <version>${spring-boot-starter.version}</version>
56                 <type>pom</type>
57                 <scope>import</scope>
58             </dependency>
59         </dependencies>
60     </dependencyManagement>
61
62     <dependencies>
63         <dependency>
64             <groupId>org.springframework.boot</groupId>
65             <artifactId>spring-boot-starter-web</artifactId>
66             <version>${spring-boot-starter.version}</version>
67             <exclusions>
68                 <exclusion>
69                     <groupId>org.springframework.boot</groupId>
70                     <artifactId>spring-boot-starter-logging</artifactId>
71                 </exclusion>
72             </exclusions>
73         </dependency>
74         <dependency>
75             <groupId>org.springframework.boot</groupId>
76             <artifactId>spring-boot-starter-log4j2</artifactId>
77             <version>${spring-boot-starter-log4j2.version}</version>
78         </dependency>
79         <dependency>
80             <groupId>org.springframework.boot</groupId>
81             <artifactId>spring-boot-starter-test</artifactId>
82             <version>${spring-boot-starter.version}</version>
83             <scope>test</scope>
84             <exclusions>
85                 <exclusion>
86                     <groupId>org.junit.vintage</groupId>
87                     <artifactId>junit-vintage-engine</artifactId>
88                 </exclusion>
89             </exclusions>
90         </dependency>
91         <dependency>
92             <groupId>org.mockito</groupId>
93             <artifactId>mockito-core</artifactId>
94             <version>${mockito-core.version}</version>
95             <scope>test</scope>
96         </dependency>
97         <dependency>
98             <groupId>org.assertj</groupId>
99             <artifactId>assertj-core</artifactId>
100             <version>${assertj-core.version}</version>
101             <scope>test</scope>
102         </dependency>
103         <dependency>
104             <groupId>org.springframework.boot</groupId>
105             <artifactId>spring-boot-starter-actuator</artifactId>
106             <version>${spring-boot-starter-actuator.version}</version>
107         </dependency>
108         <dependency>
109             <groupId>org.springdoc</groupId>
110             <artifactId>springdoc-openapi-ui</artifactId>
111             <version>${springdoc-openapi-ui.version}</version>
112         </dependency>
113         <dependency>
114             <groupId>org.bouncycastle</groupId>
115             <artifactId>bcpkix-jdk15on</artifactId>
116             <version>${bouncycastle.version}</version>
117         </dependency>
118         <dependency>
119             <groupId>org.bouncycastle</groupId>
120             <artifactId>bcprov-jdk15on</artifactId>
121             <version>${bouncycastle.version}</version>
122         </dependency>
123     </dependencies>
124
125     <build>
126         <pluginManagement>
127             <plugins>
128                 <plugin>
129                     <groupId>org.springframework.boot</groupId>
130                     <artifactId>spring-boot-maven-plugin</artifactId>
131                     <version>${spring-boot-starter.version}</version>
132                 </plugin>
133                 <plugin>
134                     <artifactId>maven-javadoc-plugin</artifactId>
135                     <version>${maven-javadoc-plugin.version}</version>
136                 </plugin>
137                 <plugin>
138                     <groupId>org.apache.maven.plugins</groupId>
139                     <artifactId>maven-surefire-plugin</artifactId>
140                     <version>${maven-surefire-plugin.version}</version>
141                 </plugin>
142             </plugins>
143         </pluginManagement>
144         <plugins>
145             <plugin>
146                 <groupId>org.springframework.boot</groupId>
147                 <artifactId>spring-boot-maven-plugin</artifactId>
148                 <executions>
149                     <execution>
150                         <goals>
151                             <goal>repackage</goal>
152                         </goals>
153                     </execution>
154                     <execution>
155                         <id>pre-integration-test</id>
156                         <goals>
157                             <goal>start</goal>
158                         </goals>
159                     </execution>
160                     <execution>
161                         <id>post-integration-test</id>
162                         <goals>
163                             <goal>stop</goal>
164                         </goals>
165                     </execution>
166                 </executions>
167             </plugin>
168             <plugin>
169                 <artifactId>maven-javadoc-plugin</artifactId>
170                 <configuration>
171                     <quiet>true</quiet>
172                     <verbose>false</verbose>
173                     <useStandardDocletOptions>false</useStandardDocletOptions>
174                     <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
175                 </configuration>
176                 <executions>
177                     <execution>
178                         <id>aggregate</id>
179                         <phase>site</phase>
180                         <goals>
181                             <goal>aggregate</goal>
182                         </goals>
183                     </execution>
184                     <execution>
185                         <id>attach-javadoc</id>
186                         <goals>
187                             <goal>jar</goal>
188                         </goals>
189                     </execution>
190                 </executions>
191             </plugin>
192             <plugin>
193                 <groupId>org.springdoc</groupId>
194                 <artifactId>springdoc-openapi-maven-plugin</artifactId>
195                 <version>${springdoc-openapi-maven-plugin.version}</version>
196                 <executions>
197                     <execution>
198                         <phase>integration-test</phase>
199                         <goals>
200                             <goal>generate</goal>
201                         </goals>
202                     </execution>
203                 </executions>
204                 <configuration>
205                     <apiDocsUrl>${springdoc-openapi-maven-plugin.apiDocsUrl}</apiDocsUrl>
206                     <outputFileName>api-docs.json</outputFileName>
207                     <outputDir>${project.build.directory}</outputDir>
208                 </configuration>
209             </plugin>
210         </plugins>
211     </build>
212
213     <profiles>
214         <profile>
215             <id>docker-staging</id>
216             <properties>
217                 <docker.tag>${project.version}-STAGING-${maven.build.timestamp}</docker.tag>
218                 <docker.latest.tag>${project.version}-STAGING-latest</docker.latest.tag>
219             </properties>
220         </profile>
221
222         <profile>
223             <id>docker</id>
224             <activation>
225                 <activeByDefault>false</activeByDefault>
226             </activation>
227             <build>
228                 <plugins>
229                     <plugin>
230                         <groupId>io.fabric8</groupId>
231                         <artifactId>docker-maven-plugin</artifactId>
232                         <version>${docker-maven-plugin.version}</version>
233                         <executions>
234                             <execution>
235                                 <id>clean-images</id>
236                                 <phase>pre-clean</phase>
237                                 <goals>
238                                     <goal>remove</goal>
239                                 </goals>
240                                 <configuration>
241                                     <removeAll>true</removeAll>
242                                     <image>${docker-maven-plugin.image-name}</image>
243                                 </configuration>
244                             </execution>
245                             <execution>
246                                 <id>generate-images</id>
247                                 <phase>install</phase>
248                                 <goals>
249                                     <goal>build</goal>
250                                 </goals>
251                             </execution>
252 <!--                            It has to be published on nexus firstly to uncomment integration tests-->
253 <!--                            <execution>-->
254 <!--                                <id>start</id>-->
255 <!--                                <phase>pre-integration-test</phase>-->
256 <!--                                <goals>-->
257 <!--                                    <goal>start</goal>-->
258 <!--                                </goals>-->
259 <!--                            </execution>-->
260 <!--                            <execution>-->
261 <!--                                <id>stop</id>-->
262 <!--                                <phase>post-integration-test</phase>-->
263 <!--                                <goals>-->
264 <!--                                    <goal>stop</goal>-->
265 <!--                                </goals>-->
266 <!--                            </execution>-->
267                             <execution>
268                                 <id>push-images</id>
269                                 <phase>deploy</phase>
270                                 <goals>
271                                     <goal>push</goal>
272                                 </goals>
273                                 <configuration>
274                                     <image>${docker-maven-plugin.image-name}</image>
275                                 </configuration>
276                             </execution>
277                         </executions>
278                         <configuration>
279                             <apiVersion>1.23</apiVersion>
280                             <registry>nexus3.onap.org:10001</registry>
281                             <authConfig>
282                                 <pull>
283                                     <username>docker</username>
284                                     <password>docker</password>
285                                 </pull>
286                             </authConfig>
287                             <images>
288                                 <image>
289                                     <name>${docker-maven-plugin.image-name}</name>
290                                     <alias>cert-service</alias>
291                                     <build>
292                                         <dockerFile>${project.basedir}/Dockerfile</dockerFile >
293                                         <tags>
294                                             <tag>${docker.tag}</tag>
295                                         </tags>
296                                     </build>
297                                     <run>
298                                         <ports>
299                                             <port>8080:8080</port>
300                                         </ports>
301                                         <wait>
302                                             <!-- Check for this URL to return a 200 return code .... -->
303                                             <url>http://localhost:8080/actuator/health</url>
304                                             <time>120000</time>
305                                         </wait>
306                                     </run>
307                                 </image>
308                             </images>
309                         </configuration>
310                     </plugin>
311                 </plugins>
312             </build>
313         </profile>
314     </profiles>
315
316     <distributionManagement>
317         <repository>
318             <id>ecomp-releases</id>
319             <name>AAF Release Repository</name>
320             <url>${nexusproxy}${releaseNexusPath}</url>
321         </repository>
322         <snapshotRepository>
323             <id>ecomp-snapshots</id>
324             <name>AAF Snapshot Repository</name>
325             <url>${nexusproxy}${snapshotNexusPath}</url>
326         </snapshotRepository>
327         <site>
328             <id>ecomp-site</id>
329             <url>dav:${nexusproxy}${sitePath}</url>
330         </site>
331     </distributionManagement>
332
333 </project>