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