Correctly document docker build
[dmaap/buscontroller.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index 14e1cc3..961076a 100644 (file)
--- a/pom.xml
+++ b/pom.xml
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.onap.dmaap.buscontroller</groupId>
   <artifactId>buscontroller</artifactId>
-  <version>${artifact.version}</version>
+  <version>1.0.1</version>
   <name>dmaap-buscontroller</name>
   <parent>
     <groupId>org.onap.oparent</groupId>
     <artifactId>oparent</artifactId>
-    <version>0.1.0</version>
+    <version>0.1.1</version>
     <relativePath/>
   </parent>
   <build>
     <finalName>buscontroller</finalName>
 
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>3.0.0-M1</version>
+        <executions>
+          <execution>
+            <id>enforce-no-snapshots</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireReleaseDeps>
+                  <message>No Snapshots Allowed!</message>
+                  <excludes>
+                    <exclude>org.onap.dmaap.dbcapi:dbcapi</exclude>
+                  </excludes>
+                </requireReleaseDeps>
+              </rules>
+              <fail>true</fail>
+            </configuration>
+          </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>
+      </plugin>
+      <plugin>
+               <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>1.0.0</version>
+                <configuration>
+                                <imageName>${docker.image}</imageName>
+                            <dockerDirectory>${project.basedir}</dockerDirectory>
+                                <!--   <serverId>docker-hub</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>
+<!-- what is this?
+                                                <resource>
+                                                                <targetPath>/</targetPath>
+                                                                <directory>${project.build.directory}</directory>
+                                                                <include>**/**</include>
+                                                </resource>
+ -->
+                                </resources>
+                </configuration>
+                <executions>
+                                <execution>
+                                                <id>build-image</id>
+                                                <phase>package</phase>
+                                                <goals>
+                                                                <goal>build</goal>
+                                                </goals>
+                                                <configuration>
+                                                                <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
+                                                </configuration>
+                                </execution>
+
+                                <execution>
+                                                <id>tag-image-project-version</id>
+                                                <phase>package</phase>
+                                                <goals>
+                                                                <goal>tag</goal>
+                                                </goals>
+                                                <configuration>
+                                                                <image>${docker.image}</image>
+                                                                <newName>${docker.push.registry}/${docker.image}:${artifact.version}</newName>
+                                                                <skipDockerTag>${skip.docker.push}</skipDockerTag>
+                                                </configuration>
+                                </execution>
+
+                                <execution>
+                                                <id>tag-image-latest</id>
+                                                <phase>package</phase>
+                                                <goals>
+                                                                <goal>tag</goal>
+                                                </goals>
+                                                <configuration>
+                                                                <image>${docker.image}</image>
+                                                                <newName>${docker.push.registry}/${docker.image}:latest</newName>
+                                                                <skipDockerTag>${skip.docker.push}</skipDockerTag>
+                                                </configuration>
+                                </execution>
+
+                                <execution>
+                                                <id>push-image-latest</id>
+                                                <phase>deploy</phase>
+                                                <goals>
+                                                                <goal>push</goal>
+                                                </goals>
+                                                <configuration>
+                                                                <imageName>${docker.push.registry}/${docker.image}:${artifact.version}</imageName>
+                                                                <skipDockerPush>${skip.docker.push}</skipDockerPush>
+                                                </configuration>
+                                </execution>
+
+                                <execution>
+                                                <id>push-image</id>
+                                                <phase>deploy</phase>
+                                                <goals>
+                                                                <goal>push</goal>
+                                                </goals>
+                                                <configuration>
+                                                                <imageName>${docker.push.registry}/${docker.image}:latest</imageName>
+                                                                <skipDockerPush>${skip.docker.push}</skipDockerPush>
+                                                </configuration>
+                                </execution>
+                </executions>
+      </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>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-dependency-plugin</artifactId>
                     <versionRange>[2.10,)</versionRange>
-                    <goals>
-                      <goal>copy-dependencies</goal>
-                    </goals>
+                                           <phase>install</phase>
+                        <goals>
+                          <goal>copy-dependencies</goal>
+                        </goals>
                   </pluginExecutionFilter>
                   <action>
                     <ignore/>
       </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>
     <jettyVersion>9.3.7.v20160115</jettyVersion>
     <eelf.version>0.0.1</eelf.version>
-    <artifact.version>1.0.1-SNAPSHOT</artifact.version>
+    <artifact.version>1.0.1</artifact.version>
                <!--  SONAR  -->
                 <jacoco.version>0.7.7.201606060606</jacoco.version>
            <sonar-jacoco-listeners.version>3.2</sonar-jacoco-listeners.version>
            <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>
+                <skip.docker.build>true</skip.docker.build>
+                <skip.docker.push>true</skip.docker.push>
+                <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>