OCI image spec labels for PAP
[policy/pap.git] / packages / policy-pap-docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2019-2022 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.7.0-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.github.git-commit-id</groupId>
70                 <artifactId>git-commit-id-maven-plugin</artifactId>
71                 <version>5.0.0</version>
72                 <executions>
73                     <execution>
74                         <id>get-the-git-infos</id>
75                         <goals>
76                             <goal>revision</goal>
77                         </goals>
78                         <phase>initialize</phase>
79                     </execution>
80                 </executions>
81                 <configuration>
82                     <skipPoms>false</skipPoms>
83                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
84                     <includeOnlyProperties>
85                         <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
86                         <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
87                     </includeOnlyProperties>
88                     <commitIdGenerationMode>full</commitIdGenerationMode>
89                 </configuration>
90             </plugin>
91
92             <plugin>
93                 <groupId>io.fabric8</groupId>
94                 <artifactId>docker-maven-plugin</artifactId>
95
96                 <configuration>
97                     <verbose>true</verbose>
98                     <apiVersion>1.23</apiVersion>
99                     <pullRegistry>${docker.pull.registry}</pullRegistry>
100                     <pushRegistry>${docker.push.registry}</pushRegistry>
101
102                     <images>
103                         <image>
104                             <name>onap/policy-pap</name>
105                             <build>
106                                 <cleanup>try</cleanup>
107                                 <dockerFile>${dockerFile}</dockerFile>
108                                 <tags>
109                                     <tag>${project.version}</tag>
110                                     <tag>${project.version}-${maven.build.timestamp}</tag>
111                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
112                                 </tags>
113                                 <assembly>
114                                     <inline>
115                                         <dependencySets>
116                                             <dependencySet>
117                                                 <includes>
118                                                     <include>org.onap.policy.pap:policy-pap-tarball</include>
119                                                 </includes>
120                                                 <outputDirectory>/lib</outputDirectory>
121                                                 <outputFileNameMapping>policy-pap.tar.gz</outputFileNameMapping>
122                                             </dependencySet>
123                                             <dependencySet>
124                                                 <includes>
125                                                     <include>org.onap.policy.pap:pap-main</include>
126                                                 </includes>
127                                                 <outputFileNameMapping>pap.jar</outputFileNameMapping>
128                                             </dependencySet>
129                                         </dependencySets>
130                                     </inline>
131                                 </assembly>
132                             </build>
133                         </image>
134                     </images>
135                 </configuration>
136
137                 <executions>
138                     <execution>
139                         <id>clean-images</id>
140                         <phase>pre-clean</phase>
141                         <goals>
142                             <goal>remove</goal>
143                         </goals>
144                         <configuration>
145                             <removeAll>true</removeAll>
146                         </configuration>
147                     </execution>
148
149                     <execution>
150                         <id>generate-images</id>
151                         <phase>generate-sources</phase>
152                         <goals>
153                             <goal>build</goal>
154                         </goals>
155                     </execution>
156
157                     <execution>
158                         <id>push-images</id>
159                         <phase>deploy</phase>
160                         <goals>
161                             <goal>build</goal>
162                             <goal>push</goal>
163                         </goals>
164                         <configuration>
165                             <image>onap/policy-pap</image>
166                         </configuration>
167                     </execution>
168                 </executions>
169             </plugin>
170
171             <plugin>
172                 <groupId>org.apache.maven.plugins</groupId>
173                 <artifactId>maven-deploy-plugin</artifactId>
174                 <configuration>
175                     <skip>true</skip>
176                 </configuration>
177             </plugin>
178         </plugins>
179     </build>
180
181     <dependencies>
182         <dependency>
183             <groupId>org.onap.policy.pap</groupId>
184             <artifactId>policy-pap-tarball</artifactId>
185             <version>${project.version}</version>
186             <classifier>tarball</classifier>
187             <type>tar.gz</type>
188         </dependency>
189     </dependencies>
190 </project>