Move git-commit-id-maven-plugin to parent pom
[policy/apex-pdp.git] / packages / apex-pdp-docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2018 Ericsson. All rights reserved.
4    Modifications Copyright (C) 2019-2020 Bell Canada.
5    Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
6    Modifications Copyright (C) 2022 Nordix Foundation.
7   ================================================================================
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11
12        http://www.apache.org/licenses/LICENSE-2.0
13
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19
20   SPDX-License-Identifier: Apache-2.0
21   ============LICENSE_END=========================================================
22 -->
23 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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     <parent>
26         <groupId>org.onap.policy.apex-pdp.packages</groupId>
27         <artifactId>apex-packages</artifactId>
28         <version>2.9.0-SNAPSHOT</version>
29     </parent>
30
31     <artifactId>apex-pdp-docker</artifactId>
32     <packaging>pom</packaging>
33     <name>Policy APEX PDP - Docker build</name>
34     <description>ONAP Policy APEX PDP Docker Build</description>
35
36     <properties>
37         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
39         <dist.project.version>${project.version}</dist.project.version>
40         <docker.skip>false</docker.skip>
41         <docker.skip.build>false</docker.skip.build>
42         <docker.skip.push>false</docker.skip.push>
43         <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
44         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
45     </properties>
46
47     <build>
48         <finalName>${project.artifactId}-${project.version}</finalName>
49         <plugins>
50             <plugin>
51                 <groupId>org.codehaus.gmaven</groupId>
52                 <artifactId>groovy-maven-plugin</artifactId>
53                 <version>2.1.1</version>
54                 <executions>
55                     <execution>
56                         <phase>validate</phase>
57                         <goals>
58                             <goal>execute</goal>
59                         </goals>
60                         <configuration>
61                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
62                         </configuration>
63                     </execution>
64                 </executions>
65             </plugin>
66
67             <plugin>
68                 <groupId>io.github.git-commit-id</groupId>
69                 <artifactId>git-commit-id-maven-plugin</artifactId>
70             </plugin>
71
72             <plugin>
73                 <groupId>io.fabric8</groupId>
74                 <artifactId>docker-maven-plugin</artifactId>
75                 <configuration>
76                     <verbose>true</verbose>
77                     <apiVersion>1.23</apiVersion>
78                     <pullRegistry>${docker.pull.registry}</pullRegistry>
79                     <pushRegistry>${docker.push.registry}</pushRegistry>
80                     <images>
81                         <image>
82                             <name>onap/policy-apex-pdp</name>
83                             <build>
84                                 <cleanup>try</cleanup>
85                                 <dockerFile>${dockerFile}</dockerFile>
86                                 <contextDir>${docker.contextDir}</contextDir>
87                                 <tags>
88                                     <tag>${project.version}</tag>
89                                     <tag>${project.version}-${maven.build.timestamp}</tag>
90                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
91                                 </tags>
92                                 <assembly>
93                                     <inline>
94                                         <dependencySets>
95                                             <dependencySet>
96                                                 <includes>
97                                                     <include>org.onap.policy.apex-pdp.packages:apex-pdp-package-full</include>
98                                                 </includes>
99                                                 <outputDirectory>.</outputDirectory>
100                                                 <outputFileNameMapping>apex-pdp-package-full.tar.gz</outputFileNameMapping>
101                                             </dependencySet>
102                                         </dependencySets>
103                                     </inline>
104                                 </assembly>
105                             </build>
106                         </image>
107                     </images>
108                 </configuration>
109                 <executions>
110                     <execution>
111                         <id>clean-images</id>
112                         <phase>pre-clean</phase>
113                         <goals>
114                             <goal>remove</goal>
115                         </goals>
116                         <configuration>
117                             <removeAll>true</removeAll>
118                         </configuration>
119                     </execution>
120                     <execution>
121                         <id>generate-images</id>
122                         <phase>generate-sources</phase>
123                         <goals>
124                             <goal>build</goal>
125                         </goals>
126                     </execution>
127                     <execution>
128                         <id>push-images</id>
129                         <phase>deploy</phase>
130                         <goals>
131                             <goal>build</goal>
132                             <goal>push</goal>
133                         </goals>
134                         <configuration>
135                             <image>onap/policy-apex-pdp</image>
136                         </configuration>
137                     </execution>
138                 </executions>
139             </plugin>
140
141             <plugin>
142                 <groupId>org.apache.maven.plugins</groupId>
143                 <artifactId>maven-deploy-plugin</artifactId>
144                 <configuration>
145                     <skip>true</skip>
146                 </configuration>
147             </plugin>
148         </plugins>
149     </build>
150     <dependencies>
151         <dependency>
152             <groupId>${project.groupId}</groupId>
153             <artifactId>apex-pdp-package-full</artifactId>
154             <version>${project.version}</version>
155             <type>tar.gz</type>
156         </dependency>
157     </dependencies>
158 </project>