Fix docker image generation when not profile is selected
[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>0.0.1-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.6.0</jib-maven-plugin.version>
39         <minimum-coverage>0.0</minimum-coverage>
40         <nexus.repository>nexus3.onap.org:10003/onap/</nexus.repository>
41     </properties>
42
43     <dependencies>
44         <dependency>
45             <groupId>org.springframework.boot</groupId>
46             <artifactId>spring-boot-starter-web</artifactId>
47             <exclusions>
48                 <exclusion>
49                     <groupId>org.springframework.boot</groupId>
50                     <artifactId>spring-boot-starter-tomcat</artifactId>
51                 </exclusion>
52             </exclusions>
53         </dependency>
54         <dependency>
55             <groupId>org.springframework.boot</groupId>
56             <artifactId>spring-boot-starter-actuator</artifactId>
57         </dependency>
58         <dependency>
59             <groupId>org.springframework.cloud</groupId>
60             <artifactId>spring-cloud-starter-sleuth</artifactId>
61         </dependency>
62     </dependencies>
63
64     <build>
65         <pluginManagement>
66             <plugins>
67                 <plugin>
68                     <groupId>com.google.cloud.tools</groupId>
69                     <artifactId>jib-maven-plugin</artifactId>
70                     <version>${jib-maven-plugin.version}</version>
71                     <configuration>
72                         <container>
73                             <mainClass>${app}</mainClass>
74                             <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
75                         </container>
76                         <from>
77                             <image>${base.image}</image>
78                         </from>
79                         <to>
80                             <image>${nexus.repository}${image.name}:${image.version}</image>
81                         </to>
82                     </configuration>
83                     <executions>
84                         <execution>
85                             <phase>package</phase>
86                             <id>build</id>
87                             <goals>
88                                 <goal>dockerBuild</goal>
89                             </goals>
90                         </execution>
91                         <execution>
92                             <phase>deploy</phase>
93                             <id>buildAndPush</id>
94                             <goals>
95                                 <goal>build</goal>
96                             </goals>
97                         </execution>
98                     </executions>
99                 </plugin>
100             </plugins>
101         </pluginManagement>
102         <plugins>
103             <plugin>
104                 <groupId>org.springframework.boot</groupId>
105                 <artifactId>spring-boot-maven-plugin</artifactId>
106             </plugin>
107         </plugins>
108     </build>
109     <profiles>
110         <profile>
111             <id>cps-docker</id>
112             <activation>
113                 <activeByDefault>false</activeByDefault>
114             </activation>
115
116             <properties>
117                 <image.name>cps-service</image.name>
118             </properties>
119             <dependencies>
120                 <dependency>
121                     <groupId>${project.groupId}</groupId>
122                     <artifactId>cps-rest</artifactId>
123                 </dependency>
124             </dependencies>
125             <build>
126                 <plugins>
127                     <plugin>
128                         <groupId>com.google.cloud.tools</groupId>
129                         <artifactId>jib-maven-plugin</artifactId>
130                     </plugin>
131                 </plugins>
132             </build>
133         </profile>
134         <profile>
135             <id>xnf-docker</id>
136             <activation>
137                 <activeByDefault>false</activeByDefault>
138             </activation>
139
140             <properties>
141                 <image.name>cps-nf-proxy</image.name>
142             </properties>
143
144             <dependencies>
145                 <dependency>
146                     <groupId>${project.groupId}</groupId>
147                     <artifactId>cps-nf-proxy-rest</artifactId>
148                 </dependency>
149             </dependencies>
150             <build>
151                 <plugins>
152                     <plugin>
153                         <groupId>com.google.cloud.tools</groupId>
154                         <artifactId>jib-maven-plugin</artifactId>
155                     </plugin>
156                 </plugins>
157             </build>
158         </profile>
159         <profile>
160             <id>cps-xnf-docker</id>
161             <activation>
162                 <activeByDefault>true</activeByDefault>
163             </activation>
164
165             <properties>
166                 <image.name>cps-and-nf-proxy</image.name>
167             </properties>
168
169             <dependencies>
170                 <dependency>
171                     <groupId>${project.groupId}</groupId>
172                     <artifactId>cps-rest</artifactId>
173                 </dependency>
174                 <dependency>
175                     <groupId>${project.groupId}</groupId>
176                     <artifactId>cps-nf-proxy-rest</artifactId>
177                 </dependency>
178             </dependencies>
179             <build>
180                 <plugins>
181                     <plugin>
182                         <groupId>com.google.cloud.tools</groupId>
183                         <artifactId>jib-maven-plugin</artifactId>
184                     </plugin>
185                 </plugins>
186             </build>
187         </profile>
188     </profiles>
189 </project>