Fixes to pom and Dockerfile to create image
[dmaap/buscontroller.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index ab6347d..3703507 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
   <parent>
     <groupId>org.onap.oparent</groupId>
     <artifactId>oparent</artifactId>
-    <version>0.1.0</version>
+    <version>0.1.1</version>
     <relativePath/>
   </parent>
   <build>
           </execution>
         </executions>
       </plugin>
-         <plugin>
-        <!--Special goal to populate target/libs with dependencies to place in docker image -->
-           <groupId>org.apache.maven.plugins</groupId>
-           <artifactId>maven-dependency-plugin</artifactId>
-           <executions>
-             <execution>
-                   <phase>install</phase>
-                   <goals>
-                     <goal>copy-dependencies</goal>
-                   </goals>
-                   <configuration>
-                     <outputDirectory>${project.build.directory}/dependency</outputDirectory>
-                   </configuration>
-             </execution>
-       </executions>
+
+           <!-- Package an Uber jar -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>2.4.3</version>
+                <executions>
+                    <!-- Run shade goal on package phase -->
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <!-- NOTE: Need the following transformer else gets "Could not resolve type id 'https' into a subtype" error
+                                Solution found from here:
+                                http://stackoverflow.com/questions/27543060/why-does-dropwizard-configuration-is-not-working
+                                Some more context here:
+                                https://github.com/dropwizard/dropwizard/issues/455 -->
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <!-- add Main-Class to manifest file -->
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>org.onap.dmaap.dbcapi.server.Main</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+
+
+      <plugin>
+                <groupId>org.sonatype.plugins</groupId>
+                <artifactId>nexus-staging-maven-plugin</artifactId>
+                <version>1.6.7</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <serverId>ecomp-staging</serverId>
+                    <nexusUrl>${nexusproxy}</nexusUrl>
+                    <stagingProfileId>176c31dfe190a</stagingProfileId>
+                </configuration>
+            </plugin>
+
+      <plugin>
+               <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>1.0.0</version>
+                <configuration>
+                                <imageName>${onap.nexus.dockerregistry.daily}/${docker.image}</imageName>
+                            <dockerDirectory>${project.basedir}</dockerDirectory>
+                                <serverId>${onap.nexus.dockerregistry.daily}</serverId>
+                                <imageTags>
+                                                <imageTag>${artifact.version}</imageTag>
+                                                <imageTag>latest</imageTag>
+                                </imageTags>
+                                <forceTags>true</forceTags>
+                                <resources>
+                                                <resource>
+                                                                <targetPath>/</targetPath>
+                                                                <directory>${project.basedir}</directory>
+                                                                <excludes>
+                                                                       <exclude>target/**/*</exclude>
+                                                                       <exclude>pom.xml</exclude>
+                                                               </excludes>
+                                                </resource>
+
+                                                <resource>
+                                                                <targetPath>/</targetPath>
+                                                                <directory>${project.build.directory}</directory>
+                                                                <include>**/**</include>
+                                                </resource>
+                                </resources>
+                </configuration>
       </plugin>
 
+       <!-- for Distribution management -->
+               <plugin>
+                 <groupId>org.apache.maven.plugins</groupId>
+                 <artifactId>maven-site-plugin</artifactId>
+                 <version>3.6</version>
+                 <dependencies>
+                       <dependency>
+                         <groupId>org.apache.maven.wagon</groupId>
+                         <artifactId>wagon-webdav-jackrabbit</artifactId>
+                         <version>2.10</version>
+                       </dependency>
+                 </dependencies>
+               </plugin>
+
     </plugins>
     <pluginManagement>
       <plugins>
       </plugin>
     </plugins>
   </reporting>
+
+  <distributionManagement>
+       <site>
+               <id>ecomp-site</id>
+               <url>dav:${nexusproxy}${sitePath}</url>
+       </site>
+  </distributionManagement>
   <properties>
     <jersey.version>2.16</jersey.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
            <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
            <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
+
+       <!-- docker image -->
+                <docker.image>onap/dmaap/buscontroller</docker.image>
+
+                <nexusproxy>https://nexus.onap.org</nexusproxy>
+                <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
+
+       <!-- for Distribution Management -->
+               <sitePath>/content/sites/site/org/onap/dmaap/buscontroller/${artifact.version}</sitePath>
   </properties>
   <description>Packaging Platform (DMaaP) Bus Controller API as a Docker container. </description>
 </project>