Change to docker-maven-plugin 17/79917/1
authorRehanRaza <muhammad.rehan.raza@est.tech>
Thu, 7 Mar 2019 15:42:51 +0000 (15:42 +0000)
committerRehanRaza <muhammad.rehan.raza@est.tech>
Thu, 7 Mar 2019 15:42:51 +0000 (15:42 +0000)
Change-Id: I5dc3c5b69b2ef764992e2db76eb9cc154ff5adf7
Issue-ID: DCAEGEN2-1269
Signed-off-by: RehanRaza <muhammad.rehan.raza@est.tech>
datafile-app-server/pom.xml
datafile-app-server/src/main/docker/Dockerfile [moved from datafile-app-server/src/main/resources/Dockerfile with 100% similarity]

index e5b87eb..ace0389 100644 (file)
@@ -32,7 +32,6 @@
   <packaging>jar</packaging>
 
   <properties>
-    <dockerfile.maven.version>1.4.10</dockerfile.maven.version>
     <docker.image.name>onap/${project.groupId}.${project.artifactId}</docker.image.name>
     <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
   </properties>
       </plugin>
       <plugin>
         <groupId>com.spotify</groupId>
-        <artifactId>dockerfile-maven-plugin</artifactId>
-        <version>${dockerfile.maven.version}</version>
+        <artifactId>docker-maven-plugin</artifactId>
         <configuration>
-          <repository>${onap.nexus.dockerregistry.daily}/${docker.image.name}</repository>
-          <tag>latest</tag>
-          <dockerfile>${project.build.outputDirectory}/Dockerfile</dockerfile>
+          <serverId>${onap.nexus.dockerregistry.daily}</serverId>
+          <imageName>${docker.image.name}</imageName>
+          <imageTags>
+            <tag>latest</tag>
+          </imageTags>
+          <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
+          <resources>
+            <resource>
+              <directory>${project.build.directory}</directory>
+              <include>${project.artifactId}.jar</include>
+              <targetPath>/target</targetPath>
+            </resource>
+            <resource>
+              <targetPath>/config</targetPath>
+              <directory>${project.basedir}/config</directory>
+              <include>*</include>
+            </resource>
+          </resources>
         </configuration>
-        <dependencies>
-          <dependency>
-            <groupId>com.spotify</groupId>
-            <artifactId>docker-client</artifactId>
-            <classifier>shaded</classifier>
-            <version>8.10.0</version>
-          </dependency>
-        </dependencies>
         <executions>
           <execution>
             <id>build-image</id>
             <phase>deploy</phase>
             <goals>
               <goal>tag</goal>
-              <goal>push</goal>
             </goals>
             <configuration>
-              <image>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</image>
+              <image>${docker.image.name}:latest</image>
+              <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</newName>
+              <pushImage>true</pushImage>
             </configuration>
           </execution>
           <execution>
             <phase>deploy</phase>
             <goals>
               <goal>tag</goal>
-              <goal>push</goal>
             </goals>
             <configuration>
-              <image>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</image>
+              <image>${docker.image.name}:latest</image>
               <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}</newName>
+              <pushImage>true</pushImage>
             </configuration>
           </execution>
           <execution>
             <phase>deploy</phase>
             <goals>
               <goal>tag</goal>
-              <goal>push</goal>
             </goals>
             <configuration>
-              <image>${onap.nexus.dockerregistry.daily}/${docker.image.name}:latest</image>
+              <image>${docker.image.name}:latest</image>
               <newName>${onap.nexus.dockerregistry.daily}/${docker.image.name}:${project.version}-${maven.build.timestamp}Z</newName>
+              <pushImage>true</pushImage>
             </configuration>
           </execution>
         </executions>