Modified configuration of docker build
[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         <springdoc-openapi-maven-plugin.apiDocsUrl>http://localhost:8080/v3/api-docs
43         </springdoc-openapi-maven-plugin.apiDocsUrl>
44         <springdoc-openapi-maven-plugin.version>0.2</springdoc-openapi-maven-plugin.version>
45         <gson.version>2.8.6</gson.version>
46
47         <!-- Docker -->
48         <skipDockerPush>true</skipDockerPush>
49         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
50         <docker-image.registry>${onap.nexus.dockerregistry.daily}</docker-image.registry>
51         <docker-image.namespace>onap</docker-image.namespace>
52         <docker-image.name>${project.groupId}.${project.artifactId}</docker-image.name>
53         <docker-image.latest>${project.version}</docker-image.latest>
54         <docker.http_proxy/>
55
56     </properties>
57
58     <dependencyManagement>
59         <dependencies>
60             <dependency>
61                 <!-- Import dependency management from Spring Boot -->
62                 <groupId>org.springframework.boot</groupId>
63                 <artifactId>spring-boot-dependencies</artifactId>
64                 <version>${spring-boot-starter.version}</version>
65                 <type>pom</type>
66                 <scope>import</scope>
67             </dependency>
68         </dependencies>
69     </dependencyManagement>
70
71     <dependencies>
72         <dependency>
73             <groupId>org.springframework.boot</groupId>
74             <artifactId>spring-boot-starter-web</artifactId>
75             <version>${spring-boot-starter.version}</version>
76             <exclusions>
77                 <exclusion>
78                     <groupId>org.springframework.boot</groupId>
79                     <artifactId>spring-boot-starter-logging</artifactId>
80                 </exclusion>
81             </exclusions>
82         </dependency>
83         <dependency>
84             <groupId>org.springframework.boot</groupId>
85             <artifactId>spring-boot-starter-log4j2</artifactId>
86             <version>${spring-boot-starter-log4j2.version}</version>
87         </dependency>
88         <dependency>
89             <groupId>org.springframework.boot</groupId>
90             <artifactId>spring-boot-starter-test</artifactId>
91             <version>${spring-boot-starter.version}</version>
92             <scope>test</scope>
93             <exclusions>
94                 <exclusion>
95                     <groupId>org.junit.vintage</groupId>
96                     <artifactId>junit-vintage-engine</artifactId>
97                 </exclusion>
98             </exclusions>
99         </dependency>
100         <dependency>
101             <groupId>org.mockito</groupId>
102             <artifactId>mockito-core</artifactId>
103             <version>${mockito-core.version}</version>
104             <scope>test</scope>
105         </dependency>
106         <dependency>
107             <groupId>org.assertj</groupId>
108             <artifactId>assertj-core</artifactId>
109             <version>${assertj-core.version}</version>
110             <scope>test</scope>
111         </dependency>
112         <dependency>
113             <groupId>org.springframework.boot</groupId>
114             <artifactId>spring-boot-starter-actuator</artifactId>
115             <version>${spring-boot-starter-actuator.version}</version>
116         </dependency>
117         <dependency>
118             <groupId>org.springdoc</groupId>
119             <artifactId>springdoc-openapi-ui</artifactId>
120             <version>${springdoc-openapi-ui.version}</version>
121         </dependency>
122         <dependency>
123             <groupId>org.bouncycastle</groupId>
124             <artifactId>bcpkix-jdk15on</artifactId>
125             <version>${bouncycastle.version}</version>
126         </dependency>
127         <dependency>
128             <groupId>org.bouncycastle</groupId>
129             <artifactId>bcprov-jdk15on</artifactId>
130             <version>${bouncycastle.version}</version>
131         </dependency>
132         <dependency>
133             <groupId>com.google.code.gson</groupId>
134             <artifactId>gson</artifactId>
135             <version>${gson.version}</version>
136         </dependency>
137     </dependencies>
138
139     <build>
140         <pluginManagement>
141             <plugins>
142                 <plugin>
143                     <groupId>org.springframework.boot</groupId>
144                     <artifactId>spring-boot-maven-plugin</artifactId>
145                     <version>${spring-boot-starter.version}</version>
146                 </plugin>
147                 <plugin>
148                     <artifactId>maven-javadoc-plugin</artifactId>
149                     <version>${maven-javadoc-plugin.version}</version>
150                 </plugin>
151                 <plugin>
152                     <groupId>org.apache.maven.plugins</groupId>
153                     <artifactId>maven-surefire-plugin</artifactId>
154                     <version>${maven-surefire-plugin.version}</version>
155                 </plugin>
156             </plugins>
157         </pluginManagement>
158         <plugins>
159             <plugin>
160                 <groupId>org.springframework.boot</groupId>
161                 <artifactId>spring-boot-maven-plugin</artifactId>
162                 <executions>
163                     <execution>
164                         <goals>
165                             <goal>repackage</goal>
166                         </goals>
167                     </execution>
168                     <execution>
169                         <id>pre-integration-test</id>
170                         <goals>
171                             <goal>start</goal>
172                         </goals>
173                     </execution>
174                     <execution>
175                         <id>post-integration-test</id>
176                         <goals>
177                             <goal>stop</goal>
178                         </goals>
179                     </execution>
180                 </executions>
181             </plugin>
182             <plugin>
183                 <artifactId>maven-javadoc-plugin</artifactId>
184                 <configuration>
185                     <quiet>true</quiet>
186                     <verbose>false</verbose>
187                     <useStandardDocletOptions>false</useStandardDocletOptions>
188                     <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
189                 </configuration>
190                 <executions>
191                     <execution>
192                         <id>aggregate</id>
193                         <phase>site</phase>
194                         <goals>
195                             <goal>aggregate</goal>
196                         </goals>
197                     </execution>
198                     <execution>
199                         <id>attach-javadoc</id>
200                         <goals>
201                             <goal>jar</goal>
202                         </goals>
203                     </execution>
204                 </executions>
205             </plugin>
206             <plugin>
207                 <groupId>org.springdoc</groupId>
208                 <artifactId>springdoc-openapi-maven-plugin</artifactId>
209                 <version>${springdoc-openapi-maven-plugin.version}</version>
210                 <executions>
211                     <execution>
212                         <phase>integration-test</phase>
213                         <goals>
214                             <goal>generate</goal>
215                         </goals>
216                     </execution>
217                 </executions>
218                 <configuration>
219                     <apiDocsUrl>${springdoc-openapi-maven-plugin.apiDocsUrl}</apiDocsUrl>
220                     <outputFileName>api-docs.json</outputFileName>
221                     <outputDir>${project.build.directory}</outputDir>
222                 </configuration>
223             </plugin>
224         </plugins>
225     </build>
226
227     <profiles>
228         <profile>
229             <id>docker-staging</id>
230             <properties>
231                 <docker.tag>${project.version}-STAGING-${maven.build.timestamp}</docker.tag>
232                 <docker.latest.tag>${project.version}-STAGING-latest</docker.latest.tag>
233             </properties>
234         </profile>
235
236         <profile>
237             <id>docker</id>
238             <activation>
239                 <activeByDefault>false</activeByDefault>
240             </activation>
241             <properties>
242                 <os.detected.name>linux</os.detected.name>
243                 <os.detected.arch>x86_64</os.detected.arch>
244                 <os.detected.classifier>${os.detected.name}-${os.detected.arch}</os.detected.classifier>
245             </properties>
246             <build>
247                 <plugins>
248                     <plugin>
249                         <groupId>io.fabric8</groupId>
250                         <artifactId>docker-maven-plugin</artifactId>
251                         <version>0.26.0</version>
252                         <executions>
253                             <execution>
254                                 <id>docker-build-image</id>
255                                 <phase>package</phase>
256                                 <goals>
257                                     <goal>build</goal>
258                                 </goals>
259                             </execution>
260                             <execution>
261                                 <id>docker-push-image</id>
262                                 <phase>deploy</phase>
263                                 <goals>
264                                     <goal>push</goal>
265                                 </goals>
266                             </execution>
267                         </executions>
268                         <configuration>
269                             <skipPush>${skipDockerPush}</skipPush>
270                             <verbose>true</verbose>
271                             <imagePullPolicy>IfNotPresent</imagePullPolicy>
272                             <images>
273                                 <image>
274                                     <alias>${project.artifactId}</alias>
275                                     <name>${docker-image.namespace}/${docker-image.name}
276                                     </name>
277                                     <registry>${docker-image.registry}</registry>
278                                     <build>
279                                         <dockerFileDir>${project.basedir}</dockerFileDir>
280                                         <tags>
281                                             <tag>${project.version}-${maven.build.timestamp}Z</tag>
282                                             <tag>${project.version}</tag>
283                                             <tag>${docker-image.latest}</tag>
284                                         </tags>
285                                     </build>
286                                 </image>
287                             </images>
288                         </configuration>
289                     </plugin>
290                 </plugins>
291             </build>
292         </profile>
293     </profiles>
294
295     <distributionManagement>
296         <repository>
297             <id>ecomp-releases</id>
298             <name>AAF Release Repository</name>
299             <url>${nexusproxy}${releaseNexusPath}</url>
300         </repository>
301         <snapshotRepository>
302             <id>ecomp-snapshots</id>
303             <name>AAF Snapshot Repository</name>
304             <url>${nexusproxy}${snapshotNexusPath}</url>
305         </snapshotRepository>
306         <site>
307             <id>ecomp-site</id>
308             <url>dav:${nexusproxy}${sitePath}</url>
309         </site>
310     </distributionManagement>
311
312 </project>