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