Merge "Updated readme to hold nexus info"
[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         <gson.version>2.8.6</gson.version>
48     </properties>
49
50     <dependencyManagement>
51         <dependencies>
52             <dependency>
53                 <!-- Import dependency management from Spring Boot -->
54                 <groupId>org.springframework.boot</groupId>
55                 <artifactId>spring-boot-dependencies</artifactId>
56                 <version>${spring-boot-starter.version}</version>
57                 <type>pom</type>
58                 <scope>import</scope>
59             </dependency>
60         </dependencies>
61     </dependencyManagement>
62
63     <dependencies>
64         <dependency>
65             <groupId>org.springframework.boot</groupId>
66             <artifactId>spring-boot-starter-web</artifactId>
67             <version>${spring-boot-starter.version}</version>
68             <exclusions>
69                 <exclusion>
70                     <groupId>org.springframework.boot</groupId>
71                     <artifactId>spring-boot-starter-logging</artifactId>
72                 </exclusion>
73             </exclusions>
74         </dependency>
75         <dependency>
76             <groupId>org.springframework.boot</groupId>
77             <artifactId>spring-boot-starter-log4j2</artifactId>
78             <version>${spring-boot-starter-log4j2.version}</version>
79         </dependency>
80         <dependency>
81             <groupId>org.springframework.boot</groupId>
82             <artifactId>spring-boot-starter-test</artifactId>
83             <version>${spring-boot-starter.version}</version>
84             <scope>test</scope>
85             <exclusions>
86                 <exclusion>
87                     <groupId>org.junit.vintage</groupId>
88                     <artifactId>junit-vintage-engine</artifactId>
89                 </exclusion>
90             </exclusions>
91         </dependency>
92         <dependency>
93             <groupId>org.mockito</groupId>
94             <artifactId>mockito-core</artifactId>
95             <version>${mockito-core.version}</version>
96             <scope>test</scope>
97         </dependency>
98         <dependency>
99             <groupId>org.assertj</groupId>
100             <artifactId>assertj-core</artifactId>
101             <version>${assertj-core.version}</version>
102             <scope>test</scope>
103         </dependency>
104         <dependency>
105             <groupId>org.springframework.boot</groupId>
106             <artifactId>spring-boot-starter-actuator</artifactId>
107             <version>${spring-boot-starter-actuator.version}</version>
108         </dependency>
109         <dependency>
110             <groupId>org.springdoc</groupId>
111             <artifactId>springdoc-openapi-ui</artifactId>
112             <version>${springdoc-openapi-ui.version}</version>
113         </dependency>
114         <dependency>
115             <groupId>org.bouncycastle</groupId>
116             <artifactId>bcpkix-jdk15on</artifactId>
117             <version>${bouncycastle.version}</version>
118         </dependency>
119         <dependency>
120             <groupId>org.bouncycastle</groupId>
121             <artifactId>bcprov-jdk15on</artifactId>
122             <version>${bouncycastle.version}</version>
123         </dependency>
124         <dependency>
125             <groupId>com.google.code.gson</groupId>
126             <artifactId>gson</artifactId>
127             <version>${gson.version}</version>
128         </dependency>
129     </dependencies>
130
131     <build>
132         <pluginManagement>
133             <plugins>
134                 <plugin>
135                     <groupId>org.springframework.boot</groupId>
136                     <artifactId>spring-boot-maven-plugin</artifactId>
137                     <version>${spring-boot-starter.version}</version>
138                 </plugin>
139                 <plugin>
140                     <artifactId>maven-javadoc-plugin</artifactId>
141                     <version>${maven-javadoc-plugin.version}</version>
142                 </plugin>
143                 <plugin>
144                     <groupId>org.apache.maven.plugins</groupId>
145                     <artifactId>maven-surefire-plugin</artifactId>
146                     <version>${maven-surefire-plugin.version}</version>
147                 </plugin>
148             </plugins>
149         </pluginManagement>
150         <plugins>
151             <plugin>
152                 <groupId>org.springframework.boot</groupId>
153                 <artifactId>spring-boot-maven-plugin</artifactId>
154                 <executions>
155                     <execution>
156                         <goals>
157                             <goal>repackage</goal>
158                         </goals>
159                     </execution>
160                     <execution>
161                         <id>pre-integration-test</id>
162                         <goals>
163                             <goal>start</goal>
164                         </goals>
165                     </execution>
166                     <execution>
167                         <id>post-integration-test</id>
168                         <goals>
169                             <goal>stop</goal>
170                         </goals>
171                     </execution>
172                 </executions>
173             </plugin>
174             <plugin>
175                 <artifactId>maven-javadoc-plugin</artifactId>
176                 <configuration>
177                     <quiet>true</quiet>
178                     <verbose>false</verbose>
179                     <useStandardDocletOptions>false</useStandardDocletOptions>
180                     <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
181                 </configuration>
182                 <executions>
183                     <execution>
184                         <id>aggregate</id>
185                         <phase>site</phase>
186                         <goals>
187                             <goal>aggregate</goal>
188                         </goals>
189                     </execution>
190                     <execution>
191                         <id>attach-javadoc</id>
192                         <goals>
193                             <goal>jar</goal>
194                         </goals>
195                     </execution>
196                 </executions>
197             </plugin>
198             <plugin>
199                 <groupId>org.springdoc</groupId>
200                 <artifactId>springdoc-openapi-maven-plugin</artifactId>
201                 <version>${springdoc-openapi-maven-plugin.version}</version>
202                 <executions>
203                     <execution>
204                         <phase>integration-test</phase>
205                         <goals>
206                             <goal>generate</goal>
207                         </goals>
208                     </execution>
209                 </executions>
210                 <configuration>
211                     <apiDocsUrl>${springdoc-openapi-maven-plugin.apiDocsUrl}</apiDocsUrl>
212                     <outputFileName>api-docs.json</outputFileName>
213                     <outputDir>${project.build.directory}</outputDir>
214                 </configuration>
215             </plugin>
216         </plugins>
217     </build>
218
219     <profiles>
220         <profile>
221             <id>docker-staging</id>
222             <properties>
223                 <docker.tag>${project.version}-STAGING-${maven.build.timestamp}</docker.tag>
224                 <docker.latest.tag>${project.version}-STAGING-latest</docker.latest.tag>
225             </properties>
226         </profile>
227
228         <profile>
229             <id>docker</id>
230             <activation>
231                 <activeByDefault>false</activeByDefault>
232             </activation>
233             <build>
234                 <plugins>
235                     <plugin>
236                         <groupId>io.fabric8</groupId>
237                         <artifactId>docker-maven-plugin</artifactId>
238                         <version>${docker-maven-plugin.version}</version>
239                         <executions>
240                             <execution>
241                                 <id>clean-images</id>
242                                 <phase>pre-clean</phase>
243                                 <goals>
244                                     <goal>remove</goal>
245                                 </goals>
246                                 <configuration>
247                                     <removeAll>true</removeAll>
248                                     <image>${docker-maven-plugin.image-name}</image>
249                                 </configuration>
250                             </execution>
251                             <execution>
252                                 <id>generate-images</id>
253                                 <phase>install</phase>
254                                 <goals>
255                                     <goal>build</goal>
256                                 </goals>
257                             </execution>
258 <!--                            It has to be published on nexus firstly to uncomment integration tests-->
259 <!--                            <execution>-->
260 <!--                                <id>start</id>-->
261 <!--                                <phase>pre-integration-test</phase>-->
262 <!--                                <goals>-->
263 <!--                                    <goal>start</goal>-->
264 <!--                                </goals>-->
265 <!--                            </execution>-->
266 <!--                            <execution>-->
267 <!--                                <id>stop</id>-->
268 <!--                                <phase>post-integration-test</phase>-->
269 <!--                                <goals>-->
270 <!--                                    <goal>stop</goal>-->
271 <!--                                </goals>-->
272 <!--                            </execution>-->
273                             <execution>
274                                 <id>push-images</id>
275                                 <phase>deploy</phase>
276                                 <goals>
277                                     <goal>push</goal>
278                                 </goals>
279                                 <configuration>
280                                     <image>${docker-maven-plugin.image-name}</image>
281                                 </configuration>
282                             </execution>
283                         </executions>
284                         <configuration>
285                             <apiVersion>1.23</apiVersion>
286                             <registry>nexus3.onap.org:10001</registry>
287                             <authConfig>
288                                 <pull>
289                                     <username>docker</username>
290                                     <password>docker</password>
291                                 </pull>
292                             </authConfig>
293                             <images>
294                                 <image>
295                                     <name>${docker-maven-plugin.image-name}</name>
296                                     <alias>cert-service</alias>
297                                     <build>
298                                         <dockerFile>${project.basedir}/Dockerfile</dockerFile >
299                                         <tags>
300                                             <tag>${docker.tag}</tag>
301                                         </tags>
302                                     </build>
303                                     <run>
304                                         <ports>
305                                             <port>8080:8080</port>
306                                         </ports>
307                                         <wait>
308                                             <!-- Check for this URL to return a 200 return code .... -->
309                                             <url>http://localhost:8080/actuator/health</url>
310                                             <time>120000</time>
311                                         </wait>
312                                     </run>
313                                 </image>
314                             </images>
315                         </configuration>
316                     </plugin>
317                 </plugins>
318             </build>
319         </profile>
320     </profiles>
321
322     <distributionManagement>
323         <repository>
324             <id>ecomp-releases</id>
325             <name>AAF Release Repository</name>
326             <url>${nexusproxy}${releaseNexusPath}</url>
327         </repository>
328         <snapshotRepository>
329             <id>ecomp-snapshots</id>
330             <name>AAF Snapshot Repository</name>
331             <url>${nexusproxy}${snapshotNexusPath}</url>
332         </snapshotRepository>
333         <site>
334             <id>ecomp-site</id>
335             <url>dav:${nexusproxy}${sitePath}</url>
336         </site>
337     </distributionManagement>
338
339 </project>