0c4b81fc692cdbd1811de37c2d19937bd7769b01
[sdnc/oam.git] / installation / dmaap-listener / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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/maven-v4_0_0.xsd">
3
4         <parent>
5                 <groupId>org.onap.ccsdk.parent</groupId>
6                 <artifactId>odlparent-lite</artifactId>
7                 <version>1.1.3</version>
8         </parent>
9         <modelVersion>4.0.0</modelVersion>
10         <packaging>pom</packaging>
11         <groupId>org.onap.sdnc.oam</groupId>
12         <artifactId>installation-dmaap-listener</artifactId>
13         <version>1.4.3-SNAPSHOT</version>
14
15         <name>sdnc-oam :: installation :: ${project.artifactId}</name>
16         <description>Creates dmaap-listener Docker container</description>
17
18         <properties>
19                 <image.name>onap/sdnc-dmaap-listener-image</image.name>
20                 <sdnc.project.version>${project.version}</sdnc.project.version>
21                 <ccsdk.docker.version>0.3-STAGING-latest</ccsdk.docker.version>
22                 <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
23                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
24         </properties>
25
26
27         <build>
28                 <plugins>
29
30
31                         <plugin>
32                                 <groupId>org.codehaus.groovy.maven</groupId>
33                                 <artifactId>gmaven-plugin</artifactId>
34                                 <executions>
35                                         <execution>
36                                                 <phase>validate</phase>
37                                                 <goals>
38                                                         <goal>execute</goal>
39                                                 </goals>
40                                                 <configuration>
41                                                         <source>
42                                                                 println project.properties['sdnc.project.version'];
43                                                                 def versionArray;
44                                                                 if ( project.properties['sdnc.project.version'] != null ) {
45                                                                     versionArray = project.properties['sdnc.project.version'].split('\\.');
46                                                                 }
47
48                                                                 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT"))
49                                                                 {
50                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
51                                                                 } else {
52                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
53                                                                 }
54
55                                                                 println 'New Tag for docker:' +
56                                                                 project.properties['project.docker.latesttag.version'];
57                                                         </source>
58                                                 </configuration>
59                                         </execution>
60                                 </executions>
61                         </plugin>
62
63
64
65                         <plugin>
66                                 <artifactId>maven-resources-plugin</artifactId>
67                                 <version>2.6</version>
68                                 <executions>
69                                         <execution>
70                                                 <id>copy-dockerfile</id>
71                                                 <goals>
72                                                         <goal>copy-resources</goal>
73                                                 </goals><!-- here the phase you need -->
74                                                 <phase>validate</phase>
75                                                 <configuration>
76                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
77                                                         <resources>
78                                                                 <resource>
79                                                                         <directory>src/main/docker</directory>
80                                                                         <includes>
81                                                                                 <include>Dockerfile</include>
82                                                                         </includes>
83                                                                         <filtering>true</filtering>
84                                                                 </resource>
85                                                         </resources>
86                                                 </configuration>
87                                         </execution>
88
89                                         <execution>
90                                                 <id>copy-scripts</id>
91                                                 <goals>
92                                                         <goal>copy-resources</goal>
93                                                 </goals><!-- here the phase you need -->
94                                                 <phase>validate</phase>
95                                                 <configuration>
96                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/dmaap-listener/bin</outputDirectory>
97                                                         <resources>
98                                                                 <resource>
99                                                                         <directory>src/main/scripts</directory>
100                                                                         <includes>
101                                                                                 <include>*.sh</include>
102                                                                         </includes>
103                                                                         <filtering>false</filtering>
104                                                                 </resource>
105                                                         </resources>
106                                                 </configuration>
107                                         </execution>
108
109                                         <execution>
110                                                 <id>copy-properties</id>
111                                                 <goals>
112                                                         <goal>copy-resources</goal>
113                                                 </goals><!-- here the phase you need -->
114                                                 <phase>validate</phase>
115                                                 <configuration>
116                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
117                                                         <resources>
118                                                                 <resource>
119                                                                         <directory>src/main/properties</directory>
120                                                                         <includes>
121                                                                                 <include>*</include>
122                                                                         </includes>
123                                                                         <filtering>false</filtering>
124                                                                 </resource>
125                                                         </resources>
126                                                 </configuration>
127                                         </execution>
128
129                                 </executions>
130                         </plugin>
131                         <plugin>
132                                 <groupId>org.apache.maven.plugins</groupId>
133                                 <artifactId>maven-dependency-plugin</artifactId>
134                                 <executions>
135                                         <execution>
136                                                 <id>unpack</id>
137                                                 <goals>
138                                                         <goal>unpack</goal>
139                                                 </goals>
140                                                 <phase>initialize</phase>
141                                                 <configuration>
142                                                         <artifactItems>
143                                                                 <artifactItem>
144                                                                         <groupId>org.onap.ccsdk.sli.northbound</groupId>
145                                                                         <artifactId>dmaap-listener</artifactId>
146                                                                         <type>zip</type>
147                                                                         <version>${ccsdk.sli.northbound.version}</version>
148                                                                 </artifactItem>
149                                                         </artifactItems>
150                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/dmaap-listener</outputDirectory>
151                                                         <excludes>bin/**,**/*-javadoc.jar,**/*-sources.jar</excludes>
152                                                         <overWriteReleases>true</overWriteReleases>
153                                                         <overWriteSnapshots>true</overWriteSnapshots>
154                                                 </configuration>
155                                         </execution>
156                                 </executions>
157                         </plugin>
158
159                         <plugin>
160                                 <artifactId>exec-maven-plugin</artifactId>
161                                 <groupId>org.codehaus.mojo</groupId>
162                                 <version>1.5.0</version>
163                                 <executions>
164
165
166
167                                         <execution>
168                                                 <id>change shell permissions</id>
169                                                 <phase>process-sources</phase>
170                                                 <goals>
171                                                         <goal>exec</goal>
172                                                 </goals>
173                                                 <configuration>
174                                                         <executable>/usr/bin/find</executable>
175                                                         <arguments>
176                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
177                                                                 <argument>-name</argument>
178                                                                 <argument>*.sh</argument>
179                                                                 <argument>-exec</argument>
180                                                                 <argument>chmod</argument>
181                                                                 <argument>+x</argument>
182                                                                 <argument>{}</argument>
183                                                                 <argument>;</argument>
184                                                         </arguments>
185                                                 </configuration>
186                                         </execution>
187                                 </executions>
188                         </plugin>
189                 </plugins>
190
191         </build>
192
193         <profiles>
194                 <profile>
195                         <id>docker</id>
196                         <build>
197                                 <plugins>
198                                         <plugin>
199                                                 <groupId>io.fabric8</groupId>
200                                                 <artifactId>docker-maven-plugin</artifactId>
201                                                 <version>0.16.5</version>
202                                                 <inherited>false</inherited>
203                                                 <configuration>
204                                                         <images>
205                                                                 <image>
206                                                                         <name>${image.name}</name>
207                                                                         <build>
208                                                                                 <cleanup>try</cleanup>
209                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
210                                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
211                                                                                 <tags>
212                                                                                         <tag>${project.version}</tag>
213                                                                                         <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
214                                                                                         <tag>${project.docker.latesttag.version}</tag>
215                                                                                 </tags>
216                                                                         </build>
217                                                                 </image>
218                                                         </images>
219                                                 </configuration>
220                                                 <executions>
221                                                         <execution>
222                                                                 <id>generate-images</id>
223                                                                 <phase>package</phase>
224                                                                 <goals>
225                                                                         <goal>build</goal>
226                                                                 </goals>
227                                                         </execution>
228
229                                                         <execution>
230                                                                 <id>push-images</id>
231                                                                 <phase>deploy</phase>
232                                                                 <goals>
233                                                                         <goal>build</goal>
234                                                                         <goal>push</goal>
235                                                                 </goals>
236                                                         </execution>
237                                                 </executions>
238                                         </plugin>
239                                 </plugins>
240                         </build>
241                 </profile>
242         </profiles>
243         <organization>
244                 <name>ONAP</name>
245         </organization>
246 </project>