Move jib plugin configuration from parent 25/117025/6
authorClaudio David Gasparini <claudio.gasparini@pantheon.tech>
Wed, 20 Jan 2021 10:42:19 +0000 (11:42 +0100)
committerClaudio David Gasparini <claudio.gasparini@pantheon.tech>
Fri, 22 Jan 2021 09:45:51 +0000 (10:45 +0100)
and leave profile generating container under single module
responsible of such task

Issue-ID:  CPS-22
Signed-off-by: Claudio David Gasparini <claudio.gasparini@pantheon.tech>
Change-Id: Iaf4b0d6ef8211aab0556288912a6a49bf4c98bfd

cps-parent/pom.xml
cps-rest/pom.xml

index f427555..c3b6154 100755 (executable)
         </snapshotRepository>
     </distributionManagement>
 
-    <profiles>
-        <profile>
-            <id>docker</id>
-            <activation>
-                <activeByDefault>false</activeByDefault>
-            </activation>
-            <build>
-                <pluginManagement>
-                    <plugins>
-                        <plugin>
-                            <groupId>com.google.cloud.tools</groupId>
-                            <artifactId>jib-maven-plugin</artifactId>
-                            <version>${jib-maven-plugin.version}</version>
-                            <configuration>
-                                <container>
-                                    <mainClass>${app}</mainClass>
-                                    <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
-                                </container>
-                                <from>
-                                    <image>${base.image}</image>
-                                </from>
-                                <to>
-                                    <image>${repository.name}</image>
-                                    <tags>
-                                        <tag>${tag.version}</tag>
-                                    </tags>
-                                </to>
-                            </configuration>
-                            <executions>
-                                <execution>
-                                    <phase>package</phase>
-                                    <id>build</id>
-                                    <goals>
-                                        <goal>dockerBuild</goal>
-                                    </goals>
-                                </execution>
-                                <execution>
-                                    <phase>deploy</phase>
-                                    <id>buildAndPush</id>
-                                    <goals>
-                                        <goal>build</goal>
-                                    </goals>
-                                </execution>
-                            </executions>
-                        </plugin>
-                    </plugins>
-                </pluginManagement>
-            </build>
-        </profile>
-    </profiles>
-
     <dependencyManagement>
         <dependencies>
             <dependency>
index 128c566..49c3267 100755 (executable)
@@ -1,6 +1,6 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"\r
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\r
     <modelVersion>4.0.0</modelVersion>\r
     <parent>\r
         <groupId>org.onap.cps</groupId>\r
                 <groupId>org.springframework.boot</groupId>\r
                 <artifactId>spring-boot-maven-plugin</artifactId>\r
             </plugin>\r
-            <plugin>\r
-                <groupId>com.google.cloud.tools</groupId>\r
-                <artifactId>jib-maven-plugin</artifactId>\r
-            </plugin>\r
             <!-- Swagger code generation. -->\r
             <plugin>\r
                 <groupId>io.swagger.codegen.v3</groupId>\r
             </plugin>\r
         </plugins>\r
     </build>\r
+\r
+    <profiles>\r
+        <profile>\r
+            <id>docker</id>\r
+            <activation>\r
+                <activeByDefault>false</activeByDefault>\r
+            </activation>\r
+            <build>\r
+                <plugins>\r
+                    <plugin>\r
+                        <groupId>com.google.cloud.tools</groupId>\r
+                        <artifactId>jib-maven-plugin</artifactId>\r
+                        <executions>\r
+                            <execution>\r
+                                <phase>package</phase>\r
+                                <id>build</id>\r
+                                <goals>\r
+                                    <goal>dockerBuild</goal>\r
+                                </goals>\r
+                            </execution>\r
+                            <execution>\r
+                                <phase>deploy</phase>\r
+                                <id>buildAndPush</id>\r
+                                <goals>\r
+                                    <goal>build</goal>\r
+                                </goals>\r
+                            </execution>\r
+                        </executions>\r
+                    </plugin>\r
+                </plugins>\r
+            </build>\r
+        </profile>\r
+    </profiles>\r
 </project>\r