utilize docker-maven-plugin to create container
[dmaap/buscontroller.git] / pom.xml
1 <?xml version="1.0"?>
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   <modelVersion>4.0.0</modelVersion>
4   <groupId>org.onap.dmaap.buscontroller</groupId>
5   <artifactId>buscontroller</artifactId>
6   <version>1.0.1</version>
7   <name>dmaap-buscontroller</name>
8   <parent>
9     <groupId>org.onap.oparent</groupId>
10     <artifactId>oparent</artifactId>
11     <version>0.1.1</version>
12     <relativePath/>
13   </parent>
14   <build>
15     <finalName>buscontroller</finalName>
16
17     <plugins>
18       <plugin>
19         <groupId>org.apache.maven.plugins</groupId>
20         <artifactId>maven-enforcer-plugin</artifactId>
21         <version>3.0.0-M1</version>
22         <executions>
23           <execution>
24             <id>enforce-no-snapshots</id>
25             <goals>
26               <goal>enforce</goal>
27             </goals>
28             <configuration>
29               <rules>
30                 <requireReleaseDeps>
31                   <message>No Snapshots Allowed!</message>
32                   <excludes>
33                     <exclude>org.onap.dmaap.dbcapi:dbcapi</exclude>
34                   </excludes>
35                 </requireReleaseDeps>
36               </rules>
37               <fail>true</fail>
38             </configuration>
39           </execution>
40         </executions>
41       </plugin>
42           <plugin>
43         <!--Special goal to populate target/libs with dependencies to place in docker image -->
44             <groupId>org.apache.maven.plugins</groupId>
45             <artifactId>maven-dependency-plugin</artifactId>
46             <executions>
47               <execution>
48                     <phase>install</phase>
49                     <goals>
50                       <goal>copy-dependencies</goal>
51                     </goals>
52                     <configuration>
53                       <outputDirectory>${project.build.directory}/dependency</outputDirectory>
54                     </configuration>
55               </execution>
56        </executions>
57       </plugin>
58       <plugin>
59                 <groupId>com.spotify</groupId>
60                  <artifactId>docker-maven-plugin</artifactId>
61                  <version>1.0.0</version>
62                  <configuration>
63                                  <imageName>${docker.image}</imageName>
64                              <dockerDirectory>${project.basedir}</dockerDirectory>
65                                  <!--   <serverId>docker-hub</serverId>   -->
66                                  <imageTags>
67                                                  <imageTag>${artifact.version}</imageTag>
68                                                  <imageTag>latest</imageTag>
69                                  </imageTags>
70                                  <forceTags>true</forceTags>
71                                  <resources>
72                                                  <resource>
73                                                                  <targetPath>/</targetPath>
74                                                                  <directory>${project.basedir}</directory>
75                                                                  <excludes>
76                                                                         <exclude>target/**/*</exclude>
77                                                                         <exclude>pom.xml</exclude>
78                                                                 </excludes>
79                                                  </resource>
80 <!-- what is this?
81                                                  <resource>
82                                                                  <targetPath>/</targetPath>
83                                                                  <directory>${project.build.directory}</directory>
84                                                                  <include>**/**</include>
85                                                  </resource>
86  -->
87                                  </resources>
88                  </configuration>
89                  <executions>
90                                  <execution>
91                                                  <id>build-image</id>
92                                                  <phase>package</phase>
93                                                  <goals>
94                                                                  <goal>build</goal>
95                                                  </goals>
96                                                  <configuration>
97                                                                  <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
98                                                  </configuration>
99                                  </execution>
100
101                                  <execution>
102                                                  <id>tag-image-project-version</id>
103                                                  <phase>package</phase>
104                                                  <goals>
105                                                                  <goal>tag</goal>
106                                                  </goals>
107                                                  <configuration>
108                                                                  <image>${docker.image}</image>
109                                                                  <newName>${docker.push.registry}/${docker.image}:${artifact.version}</newName>
110                                                                  <skipDockerTag>${skip.docker.push}</skipDockerTag>
111                                                  </configuration>
112                                  </execution>
113
114                                  <execution>
115                                                  <id>tag-image-latest</id>
116                                                  <phase>package</phase>
117                                                  <goals>
118                                                                  <goal>tag</goal>
119                                                  </goals>
120                                                  <configuration>
121                                                                  <image>${docker.image}</image>
122                                                                  <newName>${docker.push.registry}/${docker.image}:latest</newName>
123                                                                  <skipDockerTag>${skip.docker.push}</skipDockerTag>
124                                                  </configuration>
125                                  </execution>
126
127                                  <execution>
128                                                  <id>push-image-latest</id>
129                                                  <phase>deploy</phase>
130                                                  <goals>
131                                                                  <goal>push</goal>
132                                                  </goals>
133                                                  <configuration>
134                                                                  <imageName>${docker.push.registry}/${docker.image}:${artifact.version}</imageName>
135                                                                  <skipDockerPush>${skip.docker.push}</skipDockerPush>
136                                                  </configuration>
137                                  </execution>
138
139                                  <execution>
140                                                  <id>push-image</id>
141                                                  <phase>deploy</phase>
142                                                  <goals>
143                                                                  <goal>push</goal>
144                                                  </goals>
145                                                  <configuration>
146                                                                  <imageName>${docker.push.registry}/${docker.image}:latest</imageName>
147                                                                  <skipDockerPush>${skip.docker.push}</skipDockerPush>
148                                                  </configuration>
149                                  </execution>
150                  </executions>
151       </plugin>
152
153     </plugins>
154     <pluginManagement>
155       <plugins>
156         <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
157         <plugin>
158           <groupId>org.eclipse.m2e</groupId>
159           <artifactId>lifecycle-mapping</artifactId>
160           <version>1.0.0</version>
161           <configuration>
162             <lifecycleMappingMetadata>
163               <pluginExecutions>
164                 <pluginExecution>
165                   <pluginExecutionFilter>
166                     <groupId>org.apache.maven.plugins</groupId>
167                     <artifactId>maven-dependency-plugin</artifactId>
168                     <versionRange>[2.10,)</versionRange>
169                                             <phase>install</phase>
170                         <goals>
171                           <goal>copy-dependencies</goal>
172                         </goals>
173                   </pluginExecutionFilter>
174                   <action>
175                     <ignore/>
176                   </action>
177                 </pluginExecution>
178               </pluginExecutions>
179             </lifecycleMappingMetadata>
180           </configuration>
181         </plugin>
182       </plugins>
183     </pluginManagement>
184   </build>
185   <dependencyManagement>
186     <dependencies>
187  
188       <dependency>
189         <groupId>org.glassfish.jersey</groupId>
190         <artifactId>jersey-bom</artifactId>
191         <version>${jersey.version}</version>
192         <type>pom</type>
193         <scope>import</scope>
194       </dependency>
195     </dependencies>
196   </dependencyManagement>
197   <dependencies>
198         <dependency>
199         <groupId>io.swagger</groupId>
200         <artifactId>swagger-core</artifactId>
201         <version>1.5.13</version>
202       </dependency>
203       <dependency>
204         <groupId>io.swagger</groupId>
205         <artifactId>swagger-jersey2-jaxrs</artifactId>
206         <version>1.5.13</version>
207       </dependency>
208        <dependency>
209         <groupId>io.swagger</groupId>
210         <artifactId>swagger-annotations</artifactId>
211         <version>1.5.13</version>
212       </dependency>   
213     <dependency>
214       <groupId>org.glassfish.jersey.containers</groupId>
215       <artifactId>jersey-container-servlet-core</artifactId>
216       <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
217       <!-- artifactId>jersey-container-servlet</artifactId -->
218     </dependency>
219     <dependency>
220       <groupId>org.glassfish.jersey.media</groupId>
221       <artifactId>jersey-media-moxy</artifactId>
222     </dependency>
223     <dependency>
224       <groupId>log4j</groupId>
225       <artifactId>log4j</artifactId>
226       <version>1.2.17</version>
227     </dependency>
228     <dependency>
229       <groupId>org.eclipse.jetty</groupId>
230       <artifactId>jetty-server</artifactId>
231       <version>${jettyVersion}</version>
232     </dependency>
233     <dependency>
234       <groupId>org.eclipse.jetty</groupId>
235       <artifactId>jetty-servlet</artifactId>
236       <version>${jettyVersion}</version>
237       <scope>compile</scope>
238     </dependency>
239     <dependency>
240       <groupId>org.eclipse.jetty</groupId>
241       <artifactId>jetty-servlets</artifactId>
242       <version>${jettyVersion}</version>
243       <scope>compile</scope>
244     </dependency>
245     <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
246     <dependency>
247       <groupId>com.googlecode.json-simple</groupId>
248       <artifactId>json-simple</artifactId>
249       <version>1.1.1</version>
250     </dependency>
251     <dependency>
252       <groupId>commons-codec</groupId>
253       <artifactId>commons-codec</artifactId>
254       <version>1.6</version>
255     </dependency>
256     <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
257     <dependency>
258       <groupId>org.postgresql</groupId>
259       <artifactId>postgresql</artifactId>
260       <version>9.4.1208.jre7</version>
261     </dependency>
262         <dependency>
263                 <groupId>com.att.eelf</groupId> 
264                 <artifactId>eelf-core</artifactId> 
265                 <version>${eelf.version}</version> 
266         </dependency>
267         <dependency>
268                 <groupId>org.onap.dmaap.dbcapi</groupId>
269                 <artifactId>dbcapi</artifactId>
270                 <version>1.0.1-SNAPSHOT</version>
271         </dependency>
272   </dependencies>
273   <reporting>
274     <plugins>
275       <plugin>
276         <groupId>org.apache.maven.plugins</groupId>
277         <artifactId>maven-javadoc-plugin</artifactId>
278         <version>2.10.4</version>
279         <configuration>
280           <failOnError>false</failOnError>
281           <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
282           <docletArtifact>
283             <groupId>org.umlgraph</groupId>
284             <artifactId>umlgraph</artifactId>
285             <version>5.6</version>
286           </docletArtifact>
287           <additionalparam>-views</additionalparam>
288           <useStandardDocletOptions>true</useStandardDocletOptions>
289         </configuration>
290       </plugin>
291     </plugins>
292   </reporting>
293   <properties>
294     <jersey.version>2.16</jersey.version>
295     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
296     <jettyVersion>9.3.7.v20160115</jettyVersion>
297     <eelf.version>0.0.1</eelf.version>
298     <artifact.version>1.0.1</artifact.version>
299                 <!--  SONAR  -->
300                  <jacoco.version>0.7.7.201606060606</jacoco.version>
301             <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
302             <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
303             <!-- Default Sonar configuration -->
304             <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
305             <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
306             <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
307             <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
308
309         <!-- docker image -->
310                  <docker.image>onap/dmaap/buscontroller</docker.image>
311                  <skip.docker.build>true</skip.docker.build>
312                  <skip.docker.push>true</skip.docker.push>
313                  <nexusproxy>https://nexus.onap.org</nexusproxy>
314                  <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
315   </properties>
316   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container. </description>
317 </project>