Reorganize pom for docker build
[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
59         <!-- for Distribution management -->
60                 <plugin>
61                   <groupId>org.apache.maven.plugins</groupId>
62                   <artifactId>maven-site-plugin</artifactId>
63                   <version>3.6</version>
64                   <dependencies>
65                         <dependency>
66                           <groupId>org.apache.maven.wagon</groupId>
67                           <artifactId>wagon-webdav-jackrabbit</artifactId>
68                           <version>2.10</version>
69                         </dependency>
70                   </dependencies>
71                 </plugin>
72
73     </plugins>
74     <pluginManagement>
75       <plugins>
76         <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
77         <plugin>
78           <groupId>org.eclipse.m2e</groupId>
79           <artifactId>lifecycle-mapping</artifactId>
80           <version>1.0.0</version>
81           <configuration>
82             <lifecycleMappingMetadata>
83               <pluginExecutions>
84                 <pluginExecution>
85                   <pluginExecutionFilter>
86                     <groupId>org.apache.maven.plugins</groupId>
87                     <artifactId>maven-dependency-plugin</artifactId>
88                     <versionRange>[2.10,)</versionRange>
89                                             <phase>install</phase>
90                         <goals>
91                           <goal>copy-dependencies</goal>
92                         </goals>
93                   </pluginExecutionFilter>
94                   <action>
95                     <ignore/>
96                   </action>
97                 </pluginExecution>
98               </pluginExecutions>
99             </lifecycleMappingMetadata>
100           </configuration>
101         </plugin>
102       </plugins>
103     </pluginManagement>
104   </build>
105   <profiles>
106    <profile>
107     <id>docker</id>
108         <build>
109          <plugins>
110       <plugin>
111                 <groupId>com.spotify</groupId>
112                  <artifactId>docker-maven-plugin</artifactId>
113                  <version>1.0.0</version>
114                  <configuration>
115                                  <imageName>${docker.image}</imageName>
116                              <dockerDirectory>${project.basedir}</dockerDirectory>
117                                  <!--   <serverId>docker-hub</serverId>   -->
118                                  <imageTags>
119                                                  <imageTag>${artifact.version}</imageTag>
120                                                  <imageTag>latest</imageTag>
121                                  </imageTags>
122                                  <forceTags>true</forceTags>
123                                  <resources>
124                                                  <resource>
125                                                                  <targetPath>/</targetPath>
126                                                                  <directory>${project.basedir}</directory>
127                                                                  <excludes>
128                                                                         <exclude>target/**/*</exclude>
129                                                                         <exclude>pom.xml</exclude>
130                                                                 </excludes>
131                                                  </resource>
132 <!-- what is this?
133                                                  <resource>
134                                                                  <targetPath>/</targetPath>
135                                                                  <directory>${project.build.directory}</directory>
136                                                                  <include>**/**</include>
137                                                  </resource>
138  -->
139                                  </resources>
140                  </configuration>
141                  <executions>
142                                  <execution>
143                                                  <id>build-image</id>
144                                                  <phase>package</phase>
145                                                  <goals>
146                                                                  <goal>build</goal>
147                                                  </goals>
148                                                  <configuration>
149                                                                  <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
150                                                  </configuration>
151                                  </execution>
152
153                                  <execution>
154                                                  <id>tag-image-project-version</id>
155                                                  <phase>package</phase>
156                                                  <goals>
157                                                                  <goal>tag</goal>
158                                                  </goals>
159                                                  <configuration>
160                                                                  <image>${docker.image}</image>
161                                                                  <newName>${docker.push.registry}/${docker.image}:${artifact.version}</newName>
162                                                                  <skipDockerTag>${skip.docker.push}</skipDockerTag>
163                                                  </configuration>
164                                  </execution>
165
166                                  <execution>
167                                                  <id>tag-image-latest</id>
168                                                  <phase>package</phase>
169                                                  <goals>
170                                                                  <goal>tag</goal>
171                                                  </goals>
172                                                  <configuration>
173                                                                  <image>${docker.image}</image>
174                                                                  <newName>${docker.push.registry}/${docker.image}:latest</newName>
175                                                                  <skipDockerTag>${skip.docker.push}</skipDockerTag>
176                                                  </configuration>
177                                  </execution>
178
179                                  <execution>
180                                                  <id>push-image-latest</id>
181                                                  <phase>deploy</phase>
182                                                  <goals>
183                                                                  <goal>push</goal>
184                                                  </goals>
185                                                  <configuration>
186                                                                  <imageName>${docker.push.registry}/${docker.image}:${artifact.version}</imageName>
187                                                                  <skipDockerPush>${skip.docker.push}</skipDockerPush>
188                                                  </configuration>
189                                  </execution>
190
191                                  <execution>
192                                                  <id>push-image</id>
193                                                  <phase>deploy</phase>
194                                                  <goals>
195                                                                  <goal>push</goal>
196                                                  </goals>
197                                                  <configuration>
198                                                                  <imageName>${docker.push.registry}/${docker.image}:latest</imageName>
199                                                                  <skipDockerPush>${skip.docker.push}</skipDockerPush>
200                                                  </configuration>
201                                  </execution>
202                  </executions>
203       </plugin>
204          </plugins>
205         </build>
206    </profile>
207   </profiles>
208   <dependencyManagement>
209     <dependencies>
210  
211       <dependency>
212         <groupId>org.glassfish.jersey</groupId>
213         <artifactId>jersey-bom</artifactId>
214         <version>${jersey.version}</version>
215         <type>pom</type>
216         <scope>import</scope>
217       </dependency>
218     </dependencies>
219   </dependencyManagement>
220   <dependencies>
221         <dependency>
222         <groupId>io.swagger</groupId>
223         <artifactId>swagger-core</artifactId>
224         <version>1.5.13</version>
225       </dependency>
226       <dependency>
227         <groupId>io.swagger</groupId>
228         <artifactId>swagger-jersey2-jaxrs</artifactId>
229         <version>1.5.13</version>
230       </dependency>
231        <dependency>
232         <groupId>io.swagger</groupId>
233         <artifactId>swagger-annotations</artifactId>
234         <version>1.5.13</version>
235       </dependency>   
236     <dependency>
237       <groupId>org.glassfish.jersey.containers</groupId>
238       <artifactId>jersey-container-servlet-core</artifactId>
239       <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
240       <!-- artifactId>jersey-container-servlet</artifactId -->
241     </dependency>
242     <dependency>
243       <groupId>org.glassfish.jersey.media</groupId>
244       <artifactId>jersey-media-moxy</artifactId>
245     </dependency>
246     <dependency>
247       <groupId>log4j</groupId>
248       <artifactId>log4j</artifactId>
249       <version>1.2.17</version>
250     </dependency>
251     <dependency>
252       <groupId>org.eclipse.jetty</groupId>
253       <artifactId>jetty-server</artifactId>
254       <version>${jettyVersion}</version>
255     </dependency>
256     <dependency>
257       <groupId>org.eclipse.jetty</groupId>
258       <artifactId>jetty-servlet</artifactId>
259       <version>${jettyVersion}</version>
260       <scope>compile</scope>
261     </dependency>
262     <dependency>
263       <groupId>org.eclipse.jetty</groupId>
264       <artifactId>jetty-servlets</artifactId>
265       <version>${jettyVersion}</version>
266       <scope>compile</scope>
267     </dependency>
268     <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
269     <dependency>
270       <groupId>com.googlecode.json-simple</groupId>
271       <artifactId>json-simple</artifactId>
272       <version>1.1.1</version>
273     </dependency>
274     <dependency>
275       <groupId>commons-codec</groupId>
276       <artifactId>commons-codec</artifactId>
277       <version>1.6</version>
278     </dependency>
279     <!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
280     <dependency>
281       <groupId>org.postgresql</groupId>
282       <artifactId>postgresql</artifactId>
283       <version>9.4.1208.jre7</version>
284     </dependency>
285         <dependency>
286                 <groupId>com.att.eelf</groupId> 
287                 <artifactId>eelf-core</artifactId> 
288                 <version>${eelf.version}</version> 
289         </dependency>
290         <dependency>
291                 <groupId>org.onap.dmaap.dbcapi</groupId>
292                 <artifactId>dbcapi</artifactId>
293                 <version>1.0.1-SNAPSHOT</version>
294         </dependency>
295   </dependencies>
296   <reporting>
297     <plugins>
298       <plugin>
299         <groupId>org.apache.maven.plugins</groupId>
300         <artifactId>maven-javadoc-plugin</artifactId>
301         <version>2.10.4</version>
302         <configuration>
303           <failOnError>false</failOnError>
304           <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
305           <docletArtifact>
306             <groupId>org.umlgraph</groupId>
307             <artifactId>umlgraph</artifactId>
308             <version>5.6</version>
309           </docletArtifact>
310           <additionalparam>-views</additionalparam>
311           <useStandardDocletOptions>true</useStandardDocletOptions>
312         </configuration>
313       </plugin>
314     </plugins>
315   </reporting>
316
317   <distributionManagement>
318         <site>
319                 <id>ecomp-site</id>
320                 <url>dav:${nexusproxy}${sitePath}</url>
321         </site>
322   </distributionManagement>
323   <properties>
324     <jersey.version>2.16</jersey.version>
325     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
326     <jettyVersion>9.3.7.v20160115</jettyVersion>
327     <eelf.version>0.0.1</eelf.version>
328     <artifact.version>1.0.1</artifact.version>
329                 <!--  SONAR  -->
330                  <jacoco.version>0.7.7.201606060606</jacoco.version>
331             <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
332             <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
333             <!-- Default Sonar configuration -->
334             <sonar.jacoco.reportPath>target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
335             <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
336             <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
337             <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
338
339         <!-- docker image -->
340                  <docker.image>onap/dmaap/buscontroller</docker.image>
341                  <skip.docker.build>true</skip.docker.build>
342                  <skip.docker.push>true</skip.docker.push>
343                  <nexusproxy>https://nexus.onap.org</nexusproxy>
344                  <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
345
346         <!-- for Distribution Management -->
347                 <sitePath>/content/sites/site/org/onap/dmaap/buscontroller/${artifact.version}</sitePath>
348   </properties>
349   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container. </description>
350 </project>