Adding distribution management to pom for docker
[music.git] / pom.xml
1 <!-- 
2  ============LICENSE_START==========================================
3  org.onap.music
4  ===================================================================
5   Copyright (c) 2017 AT&T Intellectual Property
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  ============LICENSE_END=============================================
20  ====================================================================
21 -->
22 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24     <modelVersion>4.0.0</modelVersion>
25     <groupId>org.onap.music</groupId>
26     <artifactId>MUSIC</artifactId>
27     <packaging>war</packaging>
28     <version>2.4.4</version>
29     <description>
30             This is the MUSIC REST interface, packaged as a war file.
31           </description>
32     <properties>
33         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34         <jersey1.version>1.9</jersey1.version>
35         <jersey2.version>2.26</jersey2.version>
36         <jaxrs.version>2.0.1</jaxrs.version>
37         <cassandra.version>3.0.0</cassandra.version>
38         <zookeeper.version>3.4.6</zookeeper.version>
39
40         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41
42         <!--nexus-->
43         <sitePath>/content/sites/site/org/onap/music/${project.artifactId}/${project.version}</sitePath>
44         <!--maven-->
45         <timestamp>${maven.build.timestamp}</timestamp>
46         <maven.build.timestamp.format>yyyy.MM.dd.HH.mm</maven.build.timestamp.format>
47         <!--docker -->
48         <docker.tag>${project.version}-${timestamp}</docker.tag>
49         <docker.latest.tag>${project.version}-latest</docker.latest.tag>
50     </properties>
51
52     <repositories>
53         <repository>
54             <id>maven2-repository.java.net</id>
55             <name>Java.net Repository for Maven</name>
56             <url>http://download.java.net/maven/2/</url>
57             <layout>default</layout>
58         </repository>
59     </repositories>
60     <build>
61         <finalName>MUSIC</finalName>
62         <sourceDirectory>src/main/java</sourceDirectory>
63         <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
64         <testSourceDirectory>src/test/java</testSourceDirectory>
65         <testOutputDirectory>target/test-classes</testOutputDirectory>
66         <defaultGoal>validate</defaultGoal>
67         <resources>
68             <resource>
69                 <directory>src/main/resources</directory>
70                 <filtering>true</filtering>
71             </resource>
72         </resources>
73         <plugins>
74             <plugin>
75                 <artifactId>maven-eclipse-plugin</artifactId>
76                 <version>2.9</version>
77                 <configuration>
78                     <additionalProjectnatures>
79                         <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
80                     </additionalProjectnatures>
81                     <additionalBuildcommands>
82                         <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
83                     </additionalBuildcommands>
84                     <downloadSources>true</downloadSources>
85                     <downloadJavadocs>true</downloadJavadocs>
86                 </configuration>
87             </plugin>
88             <plugin>
89                 <groupId>org.apache.maven.plugins</groupId>
90                 <artifactId>maven-compiler-plugin</artifactId>
91                 <version>3.5.1</version>
92                 <configuration>
93                     <source>1.7</source>
94                     <target>1.7</target>
95                 </configuration>
96             </plugin>
97             <plugin>
98                 <artifactId>maven-war-plugin</artifactId>
99                 <version>2.4</version>
100                 <configuration>
101                     <warSourceDirectory>WebContent</warSourceDirectory>
102                 </configuration>
103             </plugin>
104             <plugin>
105                 <groupId>org.apache.maven.plugins</groupId>
106                 <artifactId>maven-jar-plugin</artifactId>
107                 <version>2.4</version>
108                 <executions>
109                     <execution>
110                         <id>make-a-jar</id>
111                         <phase>compile</phase>
112                         <goals>
113                             <goal>jar</goal>
114                         </goals>
115                         <configuration>
116                             <excludes>
117                                 <exclude>**/*.xml</exclude>
118                                 <exclude>**/*.properties</exclude>
119                                 <exclude>**/Sample*</exclude>
120                             </excludes>
121                         </configuration>
122                     </execution>
123                 </executions>
124             </plugin>
125             <plugin>
126                 <groupId>org.apache.maven.plugins</groupId>
127                 <artifactId>maven-install-plugin</artifactId>
128                 <version>2.4</version>
129                 <executions>
130                     <execution>
131                         <phase>install</phase>
132                         <goals>
133                             <goal>install-file</goal>
134                         </goals>
135                         <configuration>
136                             <packaging>jar</packaging>
137                             <artifactId>${project.artifactId}</artifactId>
138                             <groupId>${project.groupId}</groupId>
139                             <version>${project.version}</version>
140                             <file>${project.build.directory}/${project.artifactId}.jar</file>
141                         </configuration>
142                     </execution>
143                 </executions>
144             </plugin>
145         </plugins>
146     </build>
147
148     <dependencies>
149
150         <dependency>
151             <groupId>ch.qos.logback</groupId>
152             <artifactId>logback-core</artifactId>
153             <version>1.1.3</version>
154
155             <exclusions>
156                 <exclusion>
157                     <groupId>org.slf4j</groupId>
158                     <artifactId>slf4j-log4j12</artifactId>
159                 </exclusion>
160             </exclusions>
161         </dependency>
162
163         <dependency>
164             <groupId>ch.qos.logback</groupId>
165             <artifactId>logback-classic</artifactId>
166             <version>1.1.3</version>
167             <exclusions>
168                 <exclusion>
169                     <groupId>org.slf4j</groupId>
170                     <artifactId>slf4j-log4j12</artifactId>
171                 </exclusion>
172             </exclusions>
173         </dependency>
174
175         <dependency>
176             <groupId>com.datastax.cassandra</groupId>
177             <artifactId>cassandra-driver-core</artifactId>
178             <version>${cassandra.version}</version>
179         </dependency>
180         <dependency>
181             <groupId>org.cassandraunit</groupId>
182             <artifactId>cassandra-unit</artifactId>
183             <version>3.3.0.1</version>
184         </dependency>
185         <dependency>
186             <groupId>org.apache.zookeeper</groupId>
187             <artifactId>zookeeper</artifactId>
188             <version>${zookeeper.version}</version>
189         </dependency>
190         <dependency>
191             <groupId>com.sun.jersey</groupId>
192             <artifactId>jersey-client</artifactId>
193             <version>${jersey1.version}</version>
194         </dependency>
195         <dependency>
196             <groupId>com.sun.jersey</groupId>
197             <artifactId>jersey-server</artifactId>
198             <version>${jersey1.version}</version>
199         </dependency>
200         <dependency>
201             <groupId>com.sun.jersey</groupId>
202             <artifactId>jersey-json</artifactId>
203             <version>${jersey1.version}</version>
204         </dependency>
205         <dependency>
206             <groupId>javax.servlet</groupId>
207             <artifactId>servlet-api</artifactId>
208             <version>2.4</version>
209             <scope>provided</scope>
210         </dependency>
211         <dependency>
212             <groupId>org.apache.maven</groupId>
213             <artifactId>maven-model</artifactId>
214             <version>3.3.9</version>
215         </dependency>
216         <dependency>
217             <groupId>org.apache.commons</groupId>
218             <artifactId>commons-jcs-core</artifactId>
219             <version>2.2</version>
220         </dependency>
221
222         <dependency>
223             <groupId>javax.servlet</groupId>
224             <artifactId>javax.servlet-api</artifactId>
225             <version>3.0.1</version>
226             <scope>provided</scope>
227         </dependency>
228         <dependency>
229             <groupId>commons-codec</groupId>
230             <artifactId>commons-codec</artifactId>
231             <version>1.11</version>
232         </dependency>
233
234
235         <dependency>
236             <groupId>junit</groupId>
237             <artifactId>junit</artifactId>
238             <version>4.12</version>
239             <scope>test</scope>
240         </dependency>
241
242         <dependency>
243             <groupId>org.mockito</groupId>
244             <artifactId>mockito-all</artifactId>
245             <version>1.9.0</version>
246         </dependency>
247
248
249         <dependency>
250             <groupId>io.swagger</groupId>
251             <artifactId>swagger-jersey-jaxrs</artifactId>
252             <version>1.5.0</version>
253         </dependency>
254
255         <dependency>
256             <groupId>com.google.guava</groupId>
257             <artifactId>guava</artifactId>
258             <version>19.0</version>
259         </dependency>
260
261         <dependency>
262             <groupId>com.att.eelf</groupId>
263             <artifactId>eelf-core</artifactId>
264             <version>1.0.0</version>
265         </dependency>
266     </dependencies>
267
268     <reporting>
269         <plugins>
270             <plugin>
271                 <groupId>org.apache.maven.plugins</groupId>
272                 <artifactId>maven-javadoc-plugin</artifactId>
273                 <version>2.10.3</version>
274                 <configuration>
275                     <author>true</author>
276                     <breakiterator>true</breakiterator>
277                     <version>true</version>
278                     <links>
279                         <link>https://docs.oracle.com/javase/7/docs/api/</link>
280                         <link>https://tomcat.apache.org/tomcat-7.0-doc/jspapi/</link>
281                         <link>http://docs.oracle.com/javaee/7/api/</link>
282                     </links>
283                 </configuration>
284             </plugin>
285         </plugins>
286     </reporting>
287
288         <profiles>
289                 <profile>
290                         <id>docker</id>
291                         <build>
292                                 <plugins>
293                                         <plugin>
294                                                 <groupId>io.fabric8</groupId>
295                                                 <artifactId>docker-maven-plugin</artifactId>
296                                                 <version>0.19.1</version>
297                                                 <configuration>
298                                                         <verbose>true</verbose>
299                                                         <apiVersion>1.23</apiVersion>
300                                                         <registry>nexus3.onap.org:10003</registry>
301                                                         <images>
302                                                                 <!-- MUSIC War -->
303                                                                 <image>
304                                                                         <name>music</name>
305                                                                         <alias>docker_music</alias>
306                                                                         <build>
307                                                                                 <cleanup>true</cleanup>
308                                                                                 <tags>
309                                                                                         <tag>${docker.tag}</tag>
310                                                                                         <tag>${docker.latest.tag}</tag>
311                                                                                 </tags>
312                                                                                 <dockerFileDir>${project.basedir}</dockerFileDir>
313                                                                                 <assembly>
314                                                                                         <descriptorRef>artifact</descriptorRef>
315                                                                                 </assembly>
316                                                                         </build>
317                                                                 </image>
318                                                         </images>
319                                                 </configuration>
320                                                 <executions>
321                                                         <execution>
322                                                                 <id>clean-images</id>
323                                                                 <phase>pre-clean</phase>
324                                                                 <goals>
325                                                                         <goal>remove</goal>
326                                                                 </goals>
327                                                                 <configuration>
328                                                                         <removeAll>true</removeAll>
329                                                                         <image>music</image>
330                                                                 </configuration>
331                                                         </execution>
332                                                         <execution>
333                                                                 <id>generate-images</id>
334                                                                 <phase>package</phase>
335                                                                 <goals>
336                                                                         <goal>build</goal>
337                                                                 </goals>
338                                                         </execution>
339                                                         <execution>
340                                                                 <id>push-images</id>
341                                                                 <phase>deploy</phase>
342                                                                 <goals>
343                                                                         <goal>push</goal>
344                                                                 </goals>
345                                                                 <configuration>
346                                                                         <image>music</image>
347                                                                 </configuration>
348                                                         </execution>
349                                                 </executions>
350                                         </plugin>
351                                 </plugins>
352                                 
353                         </build>
354                 </profile>
355         </profiles>
356         <distributionManagement>
357                 <site>
358                         <id>ecomp-site</id>
359                         <url>dav:${onap.nexus.url}${sitePath}</url>
360                 </site>
361         </distributionManagement>
362
363 </project>