773158ecc9b3164f6f6af0434a9127ff79c97a72
[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-2023 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>3.0.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         <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
48         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
49         <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
50         <sonar.skip>true</sonar.skip>
51     </properties>
52
53     <build>
54         <finalName>${project.artifactId}-${project.version}</finalName>
55         <plugins>
56             <plugin>
57                 <groupId>org.codehaus.gmaven</groupId>
58                 <artifactId>groovy-maven-plugin</artifactId>
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             </plugin>
76
77             <plugin>
78                 <groupId>io.fabric8</groupId>
79                 <artifactId>docker-maven-plugin</artifactId>
80
81                 <configuration>
82                     <verbose>true</verbose>
83                     <apiVersion>1.23</apiVersion>
84                     <pullRegistry>${docker.pull.registry}</pullRegistry>
85                     <pushRegistry>${docker.push.registry}</pushRegistry>
86
87                     <images>
88                         <image>
89                             <name>onap/policy-models-simulator</name>
90                             <build>
91                                 <cleanup>try</cleanup>
92                                 <dockerFile>${dockerFile}</dockerFile>
93                                 <contextDir>${docker.contextDir}</contextDir>
94                                 <tags>
95                                     <tag>${project.version}</tag>
96                                     <tag>${project.version}-${maven.build.timestamp}</tag>
97                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
98                                 </tags>
99                                 <assembly>
100                                     <inline>
101                                         <dependencySets>
102                                             <dependencySet>
103                                                 <includes>
104                                                     <include>org.onap.policy.models.sim:models-simulator-tarball</include>
105                                                 </includes>
106                                                 <outputDirectory>/lib</outputDirectory>
107                                                 <outputFileNameMapping>models-simulator.tar.gz</outputFileNameMapping>
108                                             </dependencySet>
109                                         </dependencySets>
110                                     </inline>
111                                 </assembly>
112                             </build>
113                         </image>
114                     </images>
115                 </configuration>
116
117                 <executions>
118                     <execution>
119                         <id>clean-images</id>
120                         <phase>pre-clean</phase>
121                         <goals>
122                             <goal>remove</goal>
123                         </goals>
124                         <configuration>
125                             <removeAll>true</removeAll>
126                         </configuration>
127                     </execution>
128
129                     <execution>
130                         <id>generate-images</id>
131                         <phase>generate-sources</phase>
132                         <goals>
133                             <goal>build</goal>
134                         </goals>
135                     </execution>
136
137                     <execution>
138                         <id>push-images</id>
139                         <phase>deploy</phase>
140                         <goals>
141                             <goal>build</goal>
142                             <goal>push</goal>
143                         </goals>
144                     </execution>
145                 </executions>
146             </plugin>
147
148             <plugin>
149                 <groupId>org.apache.maven.plugins</groupId>
150                 <artifactId>maven-deploy-plugin</artifactId>
151                 <configuration>
152                     <skip>true</skip>
153                 </configuration>
154             </plugin>
155         </plugins>
156     </build>
157
158     <dependencies>
159         <dependency>
160             <groupId>org.onap.policy.models.sim</groupId>
161             <artifactId>models-simulator-tarball</artifactId>
162             <version>${project.version}</version>
163             <classifier>tarball</classifier>
164             <type>tar.gz</type>
165         </dependency>
166     </dependencies>
167 </project>