c2d6df587baf1f7cec473bb0962026f5e0e2d1b4
[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.fabric8</groupId>
74                 <artifactId>docker-maven-plugin</artifactId>
75
76                 <configuration>
77                     <verbose>true</verbose>
78                     <apiVersion>1.23</apiVersion>
79                     <pullRegistry>${docker.pull.registry}</pullRegistry>
80                     <pushRegistry>${docker.push.registry}</pushRegistry>
81
82                     <images>
83                         <image>
84                             <name>onap/policy-models-simulator</name>
85                             <build>
86                                 <cleanup>try</cleanup>
87                                 <dockerFile>${dockerFile}</dockerFile>
88                                 <tags>
89                                     <tag>${project.version}</tag>
90                                     <tag>${project.version}-${maven.build.timestamp}</tag>
91                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
92                                 </tags>
93                                 <assembly>
94                                     <inline>
95                                         <dependencySets>
96                                             <dependencySet>
97                                                 <includes>
98                                                     <include>org.onap.policy.models.sim:models-simulator-tarball</include>
99                                                 </includes>
100                                                 <outputDirectory>/lib</outputDirectory>
101                                                 <outputFileNameMapping>models-simulator.tar.gz</outputFileNameMapping>
102                                             </dependencySet>
103                                         </dependencySets>
104                                     </inline>
105                                 </assembly>
106                             </build>
107                         </image>
108                     </images>
109                 </configuration>
110
111                 <executions>
112                     <execution>
113                         <id>clean-images</id>
114                         <phase>pre-clean</phase>
115                         <goals>
116                             <goal>remove</goal>
117                         </goals>
118                         <configuration>
119                             <removeAll>true</removeAll>
120                         </configuration>
121                     </execution>
122
123                     <execution>
124                         <id>generate-images</id>
125                         <phase>generate-sources</phase>
126                         <goals>
127                             <goal>build</goal>
128                         </goals>
129                     </execution>
130
131                     <execution>
132                         <id>push-images</id>
133                         <phase>deploy</phase>
134                         <goals>
135                             <goal>build</goal>
136                             <goal>push</goal>
137                         </goals>
138                         <configuration>
139                             <image>onap/policy-models-simulator</image>
140                         </configuration>
141                     </execution>
142                 </executions>
143             </plugin>
144
145             <plugin>
146                 <groupId>org.apache.maven.plugins</groupId>
147                 <artifactId>maven-deploy-plugin</artifactId>
148                 <configuration>
149                     <skip>true</skip>
150                 </configuration>
151             </plugin>
152         </plugins>
153     </build>
154
155     <dependencies>
156         <dependency>
157             <groupId>org.onap.policy.models.sim</groupId>
158             <artifactId>models-simulator-tarball</artifactId>
159             <version>${project.version}</version>
160             <classifier>tarball</classifier>
161             <type>tar.gz</type>
162         </dependency>
163     </dependencies>
164 </project>