cf5078df87496c57f4be27164f15998af9937f11
[policy/pap.git] / packages / policy-pap-docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2019 Nordix Foundation.
4    Modifications Copyright (C) 2020-2021 Bell Canada.
5    Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
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
19   SPDX-License-Identifier: Apache-2.0
20   ============LICENSE_END=========================================================
21 -->
22
23 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25     <modelVersion>4.0.0</modelVersion>
26     <parent>
27         <groupId>org.onap.policy.pap</groupId>
28         <artifactId>pap-packages</artifactId>
29         <version>2.6.3-SNAPSHOT</version>
30     </parent>
31
32     <artifactId>policy-pap-docker</artifactId>
33     <packaging>pom</packaging>
34
35     <name>${project.artifactId}</name>
36     <description>The module for creating docker images of PAP component.</description>
37
38     <properties>
39         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
41         <dist.project.version>${project.version}</dist.project.version>
42         <docker.skip>false</docker.skip>
43         <docker.skip.build>false</docker.skip.build>
44         <docker.skip.push>false</docker.skip.push>
45         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
46     </properties>
47
48     <build>
49         <finalName>${project.artifactId}-${project.version}</finalName>
50         <plugins>
51             <plugin>
52                 <groupId>org.codehaus.gmaven</groupId>
53                 <artifactId>groovy-maven-plugin</artifactId>
54                 <version>2.1.1</version>
55                 <executions>
56                     <execution>
57                         <phase>validate</phase>
58                         <goals>
59                             <goal>execute</goal>
60                         </goals>
61                         <configuration>
62                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
63                         </configuration>
64                     </execution>
65                 </executions>
66             </plugin>
67
68             <plugin>
69                 <groupId>io.fabric8</groupId>
70                 <artifactId>docker-maven-plugin</artifactId>
71
72                 <configuration>
73                     <verbose>true</verbose>
74                     <apiVersion>1.23</apiVersion>
75                     <pullRegistry>${docker.pull.registry}</pullRegistry>
76                     <pushRegistry>${docker.push.registry}</pushRegistry>
77
78                     <images>
79                         <image>
80                             <name>onap/policy-pap</name>
81                             <build>
82                                 <cleanup>try</cleanup>
83                                 <dockerFile>Dockerfile</dockerFile>
84                                 <tags>
85                                     <tag>${project.version}</tag>
86                                     <tag>${project.version}-${maven.build.timestamp}</tag>
87                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
88                                 </tags>
89                                 <assembly>
90                                     <inline>
91                                         <dependencySets>
92                                             <dependencySet>
93                                                 <includes>
94                                                     <include>org.onap.policy.pap:policy-pap-tarball</include>
95                                                 </includes>
96                                                 <outputDirectory>/lib</outputDirectory>
97                                                 <outputFileNameMapping>policy-pap.tar.gz</outputFileNameMapping>
98                                             </dependencySet>
99                                             <dependencySet>
100                                                 <includes>
101                                                     <include>org.onap.policy.pap:pap-main</include>
102                                                 </includes>
103                                                 <outputFileNameMapping>pap.jar</outputFileNameMapping>
104                                             </dependencySet>
105                                         </dependencySets>
106                                     </inline>
107                                 </assembly>
108                             </build>
109                         </image>
110                     </images>
111                 </configuration>
112
113                 <executions>
114                     <execution>
115                         <id>clean-images</id>
116                         <phase>pre-clean</phase>
117                         <goals>
118                             <goal>remove</goal>
119                         </goals>
120                         <configuration>
121                             <removeAll>true</removeAll>
122                         </configuration>
123                     </execution>
124
125                     <execution>
126                         <id>generate-images</id>
127                         <phase>generate-sources</phase>
128                         <goals>
129                             <goal>build</goal>
130                         </goals>
131                     </execution>
132
133                     <execution>
134                         <id>push-images</id>
135                         <phase>deploy</phase>
136                         <goals>
137                             <goal>build</goal>
138                             <goal>push</goal>
139                         </goals>
140                         <configuration>
141                             <image>onap/policy-pap</image>
142                         </configuration>
143                     </execution>
144                 </executions>
145             </plugin>
146
147             <plugin>
148                 <groupId>org.apache.maven.plugins</groupId>
149                 <artifactId>maven-deploy-plugin</artifactId>
150                 <configuration>
151                     <skip>true</skip>
152                 </configuration>
153             </plugin>
154         </plugins>
155     </build>
156
157     <dependencies>
158         <dependency>
159             <groupId>org.onap.policy.pap</groupId>
160             <artifactId>policy-pap-tarball</artifactId>
161             <version>${project.version}</version>
162             <classifier>tarball</classifier>
163             <type>tar.gz</type>
164         </dependency>
165     </dependencies>
166 </project>