Fix staging error, remove tests jar dependency 24/124224/1
authorliamfallon <liam.fallon@est.tech>
Wed, 15 Sep 2021 11:07:01 +0000 (12:07 +0100)
committerliamfallon <liam.fallon@est.tech>
Wed, 15 Sep 2021 11:07:06 +0000 (12:07 +0100)
We are skipping tests in staging jobs so the policy-clamp-common tests
jar is not staged. This commit introduces profiles to avoid a dependency
error in staging jobs for that jar.

Issue-ID: POLICY-3587
Change-Id: I1b893fa1cbfd5da38272b531cc7f1130421a5cc6
Signed-off-by: liamfallon <liam.fallon@est.tech>
participant/pom.xml

index 015308b..3545b9d 100644 (file)
         <module>participant-impl</module>
     </modules>
 
+    <profiles>
+        <!--  These profiles are required because the tests jar from policy-clamp-common is not available in staging
+              Jenkins jobs -->
+        <profile>
+            <id>ExcludeTestJar1</id>
+            <activation>
+                <property>
+                    <name>maven.test.skip</name>
+                    <value>false</value>
+                </property>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.onap.policy.clamp</groupId>
+                    <artifactId>policy-clamp-common</artifactId>
+                    <classifier>tests</classifier>
+                    <type>test-jar</type>
+                    <version>${project.version}</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>ExcludeTestJar2</id>
+            <activation>
+                <property>
+                    <name>skipTests</name>
+                    <value>false</value>
+                </property>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.onap.policy.clamp</groupId>
+                    <artifactId>policy-clamp-common</artifactId>
+                    <classifier>tests</classifier>
+                    <type>test-jar</type>
+                    <version>${project.version}</version>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
     <dependencies>
         <dependency>
             <groupId>org.onap.policy.clamp</groupId>
             <artifactId>policy-clamp-models</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.onap.policy.clamp</groupId>
-            <artifactId>policy-clamp-common</artifactId>
-            <classifier>tests</classifier>
-            <type>test-jar</type>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <build>