generate the 1.4.0 docker image for artifactbroker
[multicloud/framework.git] / artifactbroker / pom.xml
index 0553390..cd78335 100644 (file)
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 -->
-<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/xsd/maven-4.0.0.xsd">
+
+<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/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.onap.multicloud.framework</groupId>
         <artifactId>multicloud-framework</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
-        <relativePath />
+        <version>1.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
+    <groupId>org.onap.multicloud.framework</groupId>
     <artifactId>multicloud-framework-artifactbroker</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.4.0-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>multicloud-framework-artifactbroker</name>
     <description>artifact  broker</description>
@@ -36,7 +35,6 @@
         <policy.common.version>1.3.4</policy.common.version>
         <policy.engine.version>1.3.5</policy.engine.version>
     </properties>
-
     <modules>
         <module>model</module>
         <module>main</module>
             <artifactId>capabilities</artifactId>
             <version>${policy.common.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>2.9.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20160810</version>
+        </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <artifactId>policy-endpoints</artifactId>
             <version>${policy.common.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-databind</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.json</groupId>
+                    <artifactId>json</artifactId>
+                </exclusion>
+          </exclusions>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
             <version>2.8.4</version>
         </dependency>
     </dependencies>
-
     <build>
         <plugins>
             <plugin>
                         </goals>
                         <phase>process-sources</phase>
                         <configuration>
-                            <!-- Use Google Java Style Guide:
-                            https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
-                            with minor changes -->
                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
-                            <!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
                             <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                             <includeResources>true</includeResources>
                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
                             </excludes>
                             <consoleOutput>true</consoleOutput>
                             <failOnViolation>true</failOnViolation>
-                            <violationSeverity>warning</violationSeverity>
+                            <violationSeverity>error</violationSeverity>
                         </configuration>
                     </execution>
                 </executions>
                     <artifactId>jacoco-maven-plugin</artifactId>
                     <version>${jacoco.version}</version>
                     <configuration>
-                        <!-- Note: This exclusion list should match <sonar.exclusions> property
-                            above -->
                         <excludes>
                             <exclude>**/gen/**</exclude>
                             <exclude>**/generated-sources/**</exclude>
                         </excludes>
                     </configuration>
                     <executions>
-                        <!-- Prepares the property pointing to the JaCoCo runtime agent which
-                            is passed as VM argument when Maven the Surefire plugin is executed. -->
                         <execution>
                             <id>pre-unit-test</id>
                             <goals>
                                 <destFile>${sonar.jacoco.reportPath}</destFile>
                             </configuration>
                         </execution>
-                        <!-- Ensures that the code coverage report for unit tests is created
-                            after unit tests have been run. -->
                         <execution>
                             <id>post-unit-test</id>
                             <phase>test</phase>
             </plugins>
         </pluginManagement>
     </build>
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-resources-plugin</artifactId>
+                        <version>3.1.0</version>
+                        <executions>
+                            <execution>
+                                <id>copy-resources</id>
+                                <phase>validate</phase>
+                                <goals>
+                                    <goal>copy-resources</goal>
+                                </goals>
+                                <configuration>
+                                    <outputDirectory>${project.basedir}/docker_target</outputDirectory>
+                                    <resources>
+                                        <resource>
+                                            <directory>${project.basedir}/docker</directory>
+                                            <filtering>true</filtering>
+                                        </resource>
+                                    </resources>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-antrun-plugin</artifactId>
+                        <version>1.6</version>
+                        <executions>
+                            <execution>
+                                <phase>install</phase>
+                                <inherited>false</inherited>
+                                <configuration>
+                                    <target>
+                                        <exec executable="docker">
+                                           <arg value="build"/>
+                                           <arg value="-t"/>
+                                           <arg value="${CONTAINER_PUSH_REGISTRY}/onap/multicloud/framework:${project.version}"/>
+                                           <arg value="docker_target"/>
+                                        </exec>
+                                        <exec executable="docker">
+                                            <arg value="tag"/>
+                                            <arg value="${CONTAINER_PUSH_REGISTRY}/onap/multicloud/framework:${project.version}"/>
+                                            <arg value="${CONTAINER_PUSH_REGISTRY}/onap/multicloud/framework:latest"/>
+                                        </exec>
+                                        <exec executable="docker">
+                                            <arg value="push"/>
+                                            <arg value="${CONTAINER_PUSH_REGISTRY}/onap/multicloud/framework:${project.version}"/>
+                                        </exec>
+                                        <exec executable="docker">
+                                            <arg value="push"/>
+                                            <arg value="${CONTAINER_PUSH_REGISTRY}/onap/multicloud/framework:latest"/>
+                                        </exec>
+                                    </target>
+                                </configuration>
+                                <goals>
+                                    <goal>run</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+        </profile>
+    </profiles>
 </project>