Merge "OCI image spec labels for models-simulator"
[policy/models.git] / models-sim / packages / models-simulator-docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2020 Bell Canada.
4    Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
5    Modifications Copyright (C) 2022 Nordix Foundation.
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.models.sim</groupId>
28         <artifactId>models-sim-packages</artifactId>
29         <version>2.7.0-SNAPSHOT</version>
30     </parent>
31
32     <artifactId>models-simulator-docker</artifactId>
33     <packaging>pom</packaging>
34
35     <name>${project.artifactId}</name>
36     <description>The module for creating docker images of Simulators 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         <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
46         <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
47         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
48         <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
49         <sonar.skip>true</sonar.skip>
50     </properties>
51
52     <build>
53         <finalName>${project.artifactId}-${project.version}</finalName>
54         <plugins>
55             <plugin>
56                 <groupId>org.codehaus.gmaven</groupId>
57                 <artifactId>groovy-maven-plugin</artifactId>
58                 <version>2.1.1</version>
59                 <executions>
60                     <execution>
61                         <phase>validate</phase>
62                         <goals>
63                             <goal>execute</goal>
64                         </goals>
65                         <configuration>
66                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
67                         </configuration>
68                     </execution>
69                 </executions>
70             </plugin>
71
72             <plugin>
73                 <groupId>io.github.git-commit-id</groupId>
74                 <artifactId>git-commit-id-maven-plugin</artifactId>
75                 <version>5.0.0</version>
76                 <executions>
77                     <execution>
78                         <id>get-the-git-infos</id>
79                         <goals>
80                             <goal>revision</goal>
81                         </goals>
82                         <phase>initialize</phase>
83                     </execution>
84                 </executions>
85                 <configuration>
86                     <skipPoms>false</skipPoms>
87                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
88                     <includeOnlyProperties>
89                         <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
90                         <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
91                     </includeOnlyProperties>
92                     <commitIdGenerationMode>full</commitIdGenerationMode>
93                 </configuration>
94             </plugin>
95
96             <plugin>
97                 <groupId>io.fabric8</groupId>
98                 <artifactId>docker-maven-plugin</artifactId>
99
100                 <configuration>
101                     <verbose>true</verbose>
102                     <apiVersion>1.23</apiVersion>
103                     <pullRegistry>${docker.pull.registry}</pullRegistry>
104                     <pushRegistry>${docker.push.registry}</pushRegistry>
105
106                     <images>
107                         <image>
108                             <name>onap/policy-models-simulator</name>
109                             <build>
110                                 <cleanup>try</cleanup>
111                                 <dockerFile>${dockerFile}</dockerFile>
112                                 <tags>
113                                     <tag>${project.version}</tag>
114                                     <tag>${project.version}-${maven.build.timestamp}</tag>
115                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
116                                 </tags>
117                                 <assembly>
118                                     <inline>
119                                         <dependencySets>
120                                             <dependencySet>
121                                                 <includes>
122                                                     <include>org.onap.policy.models.sim:models-simulator-tarball</include>
123                                                 </includes>
124                                                 <outputDirectory>/lib</outputDirectory>
125                                                 <outputFileNameMapping>models-simulator.tar.gz</outputFileNameMapping>
126                                             </dependencySet>
127                                         </dependencySets>
128                                     </inline>
129                                 </assembly>
130                             </build>
131                         </image>
132                     </images>
133                 </configuration>
134
135                 <executions>
136                     <execution>
137                         <id>clean-images</id>
138                         <phase>pre-clean</phase>
139                         <goals>
140                             <goal>remove</goal>
141                         </goals>
142                         <configuration>
143                             <removeAll>true</removeAll>
144                         </configuration>
145                     </execution>
146
147                     <execution>
148                         <id>generate-images</id>
149                         <phase>generate-sources</phase>
150                         <goals>
151                             <goal>build</goal>
152                         </goals>
153                     </execution>
154
155                     <execution>
156                         <id>push-images</id>
157                         <phase>deploy</phase>
158                         <goals>
159                             <goal>build</goal>
160                             <goal>push</goal>
161                         </goals>
162                         <configuration>
163                             <image>onap/policy-models-simulator</image>
164                         </configuration>
165                     </execution>
166                 </executions>
167             </plugin>
168
169             <plugin>
170                 <groupId>org.apache.maven.plugins</groupId>
171                 <artifactId>maven-deploy-plugin</artifactId>
172                 <configuration>
173                     <skip>true</skip>
174                 </configuration>
175             </plugin>
176         </plugins>
177     </build>
178
179     <dependencies>
180         <dependency>
181             <groupId>org.onap.policy.models.sim</groupId>
182             <artifactId>models-simulator-tarball</artifactId>
183             <version>${project.version}</version>
184             <classifier>tarball</classifier>
185             <type>tar.gz</type>
186         </dependency>
187     </dependencies>
188 </project>