Add timestamp to docker snapshots
[cps.git] / cps-application / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ============LICENSE_START=======================================================
4   Copyright (c) 2021 Pantheon.tech.
5   Modifications Copyright (C) 2021 Bell Canada.
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ============LICENSE_END=========================================================
19 -->
20
21 <project xmlns="http://maven.apache.org/POM/4.0.0"
22          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24     <modelVersion>4.0.0</modelVersion>
25
26     <parent>
27         <groupId>org.onap.cps</groupId>
28         <artifactId>cps-parent</artifactId>
29         <version>1.1.0-SNAPSHOT</version>
30         <relativePath>../cps-parent/pom.xml</relativePath>
31     </parent>
32
33     <artifactId>cps-application</artifactId>
34
35     <properties>
36         <app>org.onap.cps.Application</app>
37         <image.version>${project.version}</image.version>
38         <jib-maven-plugin.version>2.8.0</jib-maven-plugin.version>
39         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
40         <minimum-coverage>0.7</minimum-coverage>
41         <nexus.repository>nexus3.onap.org:10003/onap/</nexus.repository>
42     </properties>
43
44     <dependencies>
45         <dependency>
46             <groupId>org.springframework.boot</groupId>
47             <artifactId>spring-boot-starter-web</artifactId>
48             <exclusions>
49                 <exclusion>
50                     <groupId>org.springframework.boot</groupId>
51                     <artifactId>spring-boot-starter-tomcat</artifactId>
52                 </exclusion>
53             </exclusions>
54         </dependency>
55         <dependency>
56             <groupId>org.springframework.boot</groupId>
57             <artifactId>spring-boot-starter-jetty</artifactId>
58         </dependency>
59         <dependency>
60             <groupId>org.springframework.boot</groupId>
61             <artifactId>spring-boot-starter-security</artifactId>
62         </dependency>
63         <dependency>
64             <groupId>org.springframework.boot</groupId>
65             <artifactId>spring-boot-starter-actuator</artifactId>
66         </dependency>
67         <dependency>
68             <groupId>org.springframework.cloud</groupId>
69             <artifactId>spring-cloud-starter-sleuth</artifactId>
70         </dependency>
71         <!-- T E S T   D E P E N D E N C I E S -->
72         <dependency>
73             <groupId>org.springframework.security</groupId>
74             <artifactId>spring-security-test</artifactId>
75             <scope>test</scope>
76         </dependency>
77         <dependency>
78             <groupId>org.codehaus.groovy</groupId>
79             <artifactId>groovy</artifactId>
80             <scope>test</scope>
81         </dependency>
82         <dependency>
83             <groupId>org.spockframework</groupId>
84             <artifactId>spock-core</artifactId>
85             <scope>test</scope>
86         </dependency>
87         <dependency>
88             <groupId>org.spockframework</groupId>
89             <artifactId>spock-spring</artifactId>
90             <scope>test</scope>
91         </dependency>
92         <dependency>
93             <groupId>cglib</groupId>
94             <artifactId>cglib-nodep</artifactId>
95             <scope>test</scope>
96         </dependency>
97         <dependency>
98             <groupId>org.springframework.boot</groupId>
99             <artifactId>spring-boot-starter-test</artifactId>
100             <scope>test</scope>
101             <exclusions>
102                 <exclusion>
103                     <groupId>org.junit.vintage</groupId>
104                     <artifactId>junit-vintage-engine</artifactId>
105                 </exclusion>
106             </exclusions>
107         </dependency>
108     </dependencies>
109
110     <build>
111         <pluginManagement>
112             <plugins>
113                 <plugin>
114                     <groupId>com.google.cloud.tools</groupId>
115                     <artifactId>jib-maven-plugin</artifactId>
116                     <version>${jib-maven-plugin.version}</version>
117                     <configuration>
118                         <container>
119                             <mainClass>${app}</mainClass>
120                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
121                         </container>
122                         <from>
123                             <image>${base.image}</image>
124                         </from>
125                         <to>
126                             <tags>
127                                 <tag>latest</tag>
128                             </tags>
129                             <image>${nexus.repository}${image.name}:${image.version}-${maven.build.timestamp}</image>
130                         </to>
131                     </configuration>
132                     <executions>
133                         <execution>
134                             <phase>package</phase>
135                             <id>build</id>
136                             <goals>
137                                 <goal>dockerBuild</goal>
138                             </goals>
139                         </execution>
140                         <execution>
141                             <phase>deploy</phase>
142                             <id>buildAndPush</id>
143                             <goals>
144                                 <goal>build</goal>
145                             </goals>
146                         </execution>
147                     </executions>
148                 </plugin>
149             </plugins>
150         </pluginManagement>
151         <plugins>
152             <plugin>
153                 <groupId>org.springframework.boot</groupId>
154                 <artifactId>spring-boot-maven-plugin</artifactId>
155             </plugin>
156         </plugins>
157     </build>
158     <profiles>
159         <profile>
160             <id>cps-docker</id>
161             <activation>
162                 <activeByDefault>false</activeByDefault>
163             </activation>
164
165             <properties>
166                 <image.name>cps-service</image.name>
167             </properties>
168             <dependencies>
169                 <dependency>
170                     <groupId>${project.groupId}</groupId>
171                     <artifactId>cps-rest</artifactId>
172                 </dependency>
173                 <dependency>
174                     <groupId>${project.groupId}</groupId>
175                     <artifactId>cps-ri</artifactId>
176                 </dependency>
177             </dependencies>
178             <build>
179                 <plugins>
180                     <plugin>
181                         <groupId>com.google.cloud.tools</groupId>
182                         <artifactId>jib-maven-plugin</artifactId>
183                     </plugin>
184                 </plugins>
185             </build>
186         </profile>
187         <profile>
188             <id>xnf-docker</id>
189             <activation>
190                 <activeByDefault>false</activeByDefault>
191             </activation>
192
193             <properties>
194                 <image.name>cps-nf-proxy</image.name>
195             </properties>
196
197             <dependencies>
198                 <dependency>
199                     <groupId>${project.groupId}</groupId>
200                     <artifactId>cps-nf-proxy-rest</artifactId>
201                 </dependency>
202                 <dependency>
203                     <groupId>${project.groupId}</groupId>
204                     <artifactId>cps-ri</artifactId>
205                 </dependency>
206             </dependencies>
207             <build>
208                 <plugins>
209                     <plugin>
210                         <groupId>com.google.cloud.tools</groupId>
211                         <artifactId>jib-maven-plugin</artifactId>
212                     </plugin>
213                 </plugins>
214             </build>
215         </profile>
216         <profile>
217             <id>cps-xnf-docker</id>
218             <activation>
219                 <activeByDefault>true</activeByDefault>
220             </activation>
221
222             <properties>
223                 <image.name>cps-and-nf-proxy</image.name>
224             </properties>
225
226             <dependencies>
227                 <dependency>
228                     <groupId>${project.groupId}</groupId>
229                     <artifactId>cps-rest</artifactId>
230                 </dependency>
231                 <dependency>
232                     <groupId>${project.groupId}</groupId>
233                     <artifactId>cps-nf-proxy-rest</artifactId>
234                 </dependency>
235                 <dependency>
236                     <groupId>${project.groupId}</groupId>
237                     <artifactId>cps-ri</artifactId>
238                 </dependency>
239             </dependencies>
240             <build>
241                 <plugins>
242                     <plugin>
243                         <groupId>com.google.cloud.tools</groupId>
244                         <artifactId>jib-maven-plugin</artifactId>
245                     </plugin>
246                 </plugins>
247             </build>
248         </profile>
249     </profiles>
250 </project>