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