Roll to next Guilin snapshot
[ccsdk/cds.git] / ms / sdclistener / distribution / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ~  Copyright © 2019 IBM, Bell Canada.
4   ~
5   ~  Licensed under the Apache License, Version 2.0 (the "License");
6   ~  you may not use this file except in compliance with the License.
7   ~  You may obtain a copy of the License at
8   ~
9   ~      http://www.apache.org/licenses/LICENSE-2.0
10   ~
11   ~  Unless required by applicable law or agreed to in writing, software
12   ~  distributed under the License is distributed on an "AS IS" BASIS,
13   ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   ~  See the License for the specific language governing permissions and
15   ~  limitations under the License.
16   -->
17
18 <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">
19     <modelVersion>4.0.0</modelVersion>
20
21     <parent>
22         <groupId>org.onap.ccsdk.cds.sdclistener</groupId>
23         <artifactId>parent</artifactId>
24         <version>1.0.0-SNAPSHOT</version>
25         <relativePath>../parent</relativePath>
26     </parent>
27
28     <artifactId>distribution</artifactId>
29     <packaging>pom</packaging>
30
31     <name>SDC Listener Distribution</name>
32
33     <properties>
34         <assembly.id>maven</assembly.id>
35         <name.space>org.onap.ccsdk.cds</name.space>
36         <serviceArtifactName>sdclistener</serviceArtifactName>
37         <image.name>onap/ccsdk-sdclistener</image.name>
38         <!--disabled for now to mirror #85964 https://gerrit.onap.org/r/#/c/85964/2/ms/command-executor/pom.xml-->
39         <!--<docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>-->
40         <docker.push.phase>deploy</docker.push.phase>
41         <docker.verbose>true</docker.verbose>
42         <ccsdk.project.version>${project.version}</ccsdk.project.version>
43         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
44     </properties>
45
46     <dependencies>
47         <dependency>
48             <groupId>org.onap.ccsdk.cds.sdclistener</groupId>
49             <artifactId>application</artifactId>
50         </dependency>
51     </dependencies>
52
53     <build>
54         <plugins>
55             <plugin>
56                 <artifactId>maven-resources-plugin</artifactId>
57                 <version>2.6</version>
58                 <executions>
59                     <execution>
60                         <id>copy-dockerfile</id>
61                         <goals>
62                             <goal>copy-resources</goal>
63                         </goals><!-- here the phase you need -->
64                         <phase>validate</phase>
65                         <configuration>
66                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
67                             <resources>
68                                 <resource>
69                                     <directory>src/main/docker</directory>
70                                     <includes>
71                                         <include>*</include>
72                                     </includes>
73                                     <filtering>true</filtering>
74                                 </resource>
75                             </resources>
76                         </configuration>
77                     </execution>
78                 </executions>
79             </plugin>
80             <plugin>
81                 <groupId>org.apache.maven.plugins</groupId>
82                 <artifactId>maven-antrun-plugin</artifactId>
83                 <executions>
84                     <execution>
85                         <id>ant-test</id>
86                         <phase>package</phase>
87                         <configuration>
88                             <tasks>
89                                 <fixcrlf srcdir="${basedir}" eol="unix" includes="**/*.sh, **/*.source"/>
90                             </tasks>
91                         </configuration>
92                         <goals>
93                             <goal>run</goal>
94                         </goals>
95                     </execution>
96                 </executions>
97             </plugin>
98             <plugin><!--build the final artifact for docker deployment -->
99                 <artifactId>maven-assembly-plugin</artifactId>
100                 <version>3.1.0</version>
101                 <configuration>
102                     <!-- <skipAssembly>${skip.assembly}</skipAssembly> -->
103                     <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
104                     <descriptors>
105                         <descriptor>src/main/docker/distribution.xml</descriptor>
106                     </descriptors>
107                     <tarLongFileMode>posix</tarLongFileMode>
108                 </configuration>
109                 <executions>
110                     <execution>
111                         <id>${assembly.id}</id>
112                         <phase>package</phase>
113                         <goals>
114                             <goal>single</goal>
115                         </goals>
116                     </execution>
117                 </executions>
118             </plugin>
119             <plugin>
120                 <groupId>org.codehaus.groovy.maven</groupId>
121                 <artifactId>gmaven-plugin</artifactId>
122                 <version>1.0</version>
123                 <executions>
124                     <execution>
125                         <phase>validate</phase>
126                         <goals>
127                             <goal>execute</goal>
128                         </goals>
129                         <configuration>
130                             <source>${basedir}/../../../TagVersion.groovy</source>
131                         </configuration>
132                     </execution>
133                 </executions>
134             </plugin>
135
136         </plugins>
137     </build>
138
139     <profiles>
140         <profile>
141             <id>docker</id>
142             <build>
143                 <plugins>
144                     <plugin>
145                         <groupId>io.fabric8</groupId>
146                         <artifactId>docker-maven-plugin</artifactId>
147                         <version>0.26.1</version>
148                         <inherited>false</inherited>
149                         <configuration>
150                             <images>
151                                 <image>
152                                     <name>${image.name}</name>
153                                     <build>
154                                         <cleanup>try</cleanup>
155                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
156                                         <tags>
157                                             <tag>${project.docker.latestminortag.version}</tag>
158                                             <tag>${project.docker.latestfulltag.version}</tag>
159                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
160                                         </tags>
161                                     </build>
162                                 </image>
163                             </images>
164                             <verbose>true</verbose>
165                         </configuration>
166                         <executions>
167                             <execution>
168                                 <id>generate-images</id>
169                                 <phase>package</phase>
170                                 <goals>
171                                     <goal>build</goal>
172                                 </goals>
173                             </execution>
174                             <execution>
175                                 <id>push-images</id>
176                                 <phase>${docker.push.phase}</phase>
177                                 <goals>
178                                     <goal>build</goal>
179                                     <goal>push</goal>
180                                 </goals>
181                             </execution>
182                         </executions>
183                     </plugin>
184                 </plugins>
185             </build>
186         </profile>
187     </profiles>
188 </project>