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