433814
From d8356a58efde0808cabede14b4f1b2473fa73170 Mon Sep 17 00:00:00 2001
433814
From: Mikolaj Izdebski <mizdebsk@redhat.com>
433814
Date: Tue, 31 May 2016 10:52:12 +0200
433814
Subject: [PATCH 2/2] Port to maven-jar-plugin 3.0.0
433814
433814
---
433814
 pom.xml                                            | 47 +++++-----------------
433814
 .../logging/pathable/ChildFirstTestCase.java       |  8 ++--
433814
 .../logging/pathable/ParentFirstTestCase.java      |  8 ++--
433814
 3 files changed, 17 insertions(+), 46 deletions(-)
433814
433814
diff --git a/pom.xml b/pom.xml
433814
index 5707595..c5d8d37 100644
433814
--- a/pom.xml
433814
+++ b/pom.xml
433814
@@ -237,6 +237,10 @@ under the License.
433814
         <artifactId>maven-jar-plugin</artifactId>
433814
         <executions>
433814
           <execution>
433814
+	    <id>default-jar</id>
433814
+	    <phase>skip</phase>
433814
+	  </execution>
433814
+	  <execution>
433814
             
433814
               - The custom test framework requires the unit test code to be
433814
               - in a jarfile so it can control its place in the classpath.
433814
@@ -261,7 +265,7 @@ under the License.
433814
               <goal>jar</goal>
433814
             </goals>
433814
             <configuration>
433814
-              <jarName>${project.artifactId}-api-${project.version}</jarName>
433814
+              <classifier>api</classifier>
433814
               <archive>
433814
                 <manifestFile>${project.build.directory}/osgi-api/MANIFEST.MF</manifestFile>
433814
               </archive>
433814
@@ -288,7 +292,7 @@ under the License.
433814
               <goal>jar</goal>
433814
             </goals>
433814
             <configuration>
433814
-              <jarName>${project.artifactId}-adapters-${project.version}</jarName>
433814
+              <classifier>adapters</classifier>
433814
               <archive>
433814
                 <manifestFile>${project.build.directory}/osgi-adapters/MANIFEST.MF</manifestFile>
433814
               </archive>
433814
@@ -346,39 +350,6 @@ under the License.
433814
 
433814
       <plugin>
433814
         
433814
-          - Attach the adapters and api jars to the normal artifact. This way
433814
-          - they will be deployed when the normal artifact is deployed.
433814
-          -->
433814
-        <groupId>org.codehaus.mojo</groupId>
433814
-        <artifactId>build-helper-maven-plugin</artifactId>
433814
-        <version>1.0</version>
433814
-        <executions>
433814
-          <execution>
433814
-            <id>attach-artifacts</id>
433814
-            <phase>package</phase>
433814
-            <goals>
433814
-              <goal>attach-artifact</goal>
433814
-            </goals>
433814
-            <configuration>
433814
-              <artifacts>
433814
-                <artifact>
433814
-                  <file>${project.build.directory}/${project.artifactId}-adapters-${project.version}.jar</file>
433814
-                  <type>jar</type>
433814
-                  <classifier>adapters</classifier>
433814
-                </artifact>
433814
-                <artifact>
433814
-                  <file>${project.build.directory}/${project.artifactId}-api-${project.version}.jar</file>
433814
-                  <type>jar</type>
433814
-                  <classifier>api</classifier>
433814
-                </artifact>
433814
-              </artifacts>
433814
-            </configuration>
433814
-          </execution>
433814
-        </executions>
433814
-      </plugin>
433814
-
433814
-      <plugin>
433814
-        
433814
           - Many of JCL's tests use tricky techniques to place the generated
433814
           - JCL jarfiles on the classpath in various configurations. This means
433814
           - that those tests must be run *after* the "package" build phase.
433814
@@ -442,9 +413,9 @@ under the License.
433814
                   <logkit>${logkit:logkit:jar}</logkit>
433814
                   <servlet-api>${javax.servlet:servlet-api:jar}</servlet-api>
433814
                   <commons-logging>target/${project.build.finalName}.jar</commons-logging>
433814
-                  <commons-logging-api>target/${project.artifactId}-api-${project.version}.jar</commons-logging-api>
433814
-                  <commons-logging-adapters>target/${project.artifactId}-adapters-${project.version}.jar</commons-logging-adapters>
433814
-                  <testclasses>target/commons-logging-tests.jar</testclasses>
433814
+                  <commons-logging-api>target/${project.artifactId}-${project.version}-api.jar</commons-logging-api>
433814
+                  <commons-logging-adapters>target/${project.artifactId}-${project.version}-adapters.jar</commons-logging-adapters>
433814
+                  <testclasses>target/commons-logging-${project.version}-tests.jar</testclasses>
433814
               </systemPropertyVariables>
433814
             </configuration>
433814
           </execution>
433814
diff --git a/src/test/java/org/apache/commons/logging/pathable/ChildFirstTestCase.java b/src/test/java/org/apache/commons/logging/pathable/ChildFirstTestCase.java
433814
index 1aeb12d..eb67ec1 100644
433814
--- a/src/test/java/org/apache/commons/logging/pathable/ChildFirstTestCase.java
433814
+++ b/src/test/java/org/apache/commons/logging/pathable/ChildFirstTestCase.java
433814
@@ -213,11 +213,11 @@ public class ChildFirstTestCase extends TestCase {
433814
         // getResource where it is accessable to both classloaders. The one visible
433814
         // to the child should be returned. The URL returned will be of form
433814
         //  jar:file:/x/y.jar!path/to/resource. The filename part should include the jarname
433814
-        // of form commons-logging-adapters-nnnn.jar, not commons-logging-nnnn.jar
433814
+        // of form commons-logging-nnnn-adapters.jar, not commons-logging-nnnn.jar
433814
         resource = childLoader.getResource("org/apache/commons/logging/impl/Log4JLogger.class");
433814
         assertNotNull("Unable to locate Log4JLogger.class resource", resource);
433814
         assertTrue("Incorrect source for Log4JLogger class",
433814
-                resource.toString().indexOf("/commons-logging-adapters-1.") > 0);
433814
+                resource.toString().indexOf("/commons-logging-1.2-adapters.jar!") > 0);
433814
     }
433814
 
433814
     /**
433814
@@ -269,9 +269,9 @@ public class ChildFirstTestCase extends TestCase {
433814
         urlsToStrings[1] = urls[1].toString();
433814
         Arrays.sort(urlsToStrings);
433814
         assertTrue("Incorrect source for Log4JLogger class",
433814
-                urlsToStrings[0].indexOf("/commons-logging-1.") > 0);
433814
+                urlsToStrings[0].indexOf("/commons-logging-1.2-adapters.jar!") > 0);
433814
         assertTrue("Incorrect source for Log4JLogger class",
433814
-                urlsToStrings[1].indexOf("/commons-logging-adapters-1.") > 0);
433814
+                urlsToStrings[1].indexOf("/commons-logging-1.2.jar!") > 0);
433814
     }
433814
 
433814
     /**
433814
diff --git a/src/test/java/org/apache/commons/logging/pathable/ParentFirstTestCase.java b/src/test/java/org/apache/commons/logging/pathable/ParentFirstTestCase.java
433814
index f9bf452..fc10c8e 100644
433814
--- a/src/test/java/org/apache/commons/logging/pathable/ParentFirstTestCase.java
433814
+++ b/src/test/java/org/apache/commons/logging/pathable/ParentFirstTestCase.java
433814
@@ -210,11 +210,11 @@ public class ParentFirstTestCase extends TestCase {
433814
         // getResource where it is accessable to both classloaders. The one visible
433814
         // to the parent should be returned. The URL returned will be of form
433814
         //  jar:file:/x/y.jar!path/to/resource. The filename part should include the jarname
433814
-        // of form commons-logging-nnnn.jar, not commons-logging-adapters-nnnn.jar
433814
+        // of form commons-logging-nnnn.jar, not commons-logging-nnnn-adapters.jar
433814
         resource = childLoader.getResource("org/apache/commons/logging/impl/Log4JLogger.class");
433814
         assertNotNull("Unable to locate Log4JLogger.class resource", resource);
433814
         assertTrue("Incorrect source for Log4JLogger class",
433814
-                resource.toString().indexOf("/commons-logging-1.") > 0);
433814
+                resource.toString().indexOf("/commons-logging-1.2.jar!") > 0);
433814
     }
433814
     
433814
     /**
433814
@@ -259,9 +259,9 @@ public class ParentFirstTestCase extends TestCase {
433814
         urlsToStrings[1] = urls[1].toString();
433814
         Arrays.sort(urlsToStrings);
433814
         assertTrue("Incorrect source for Log4JLogger class",
433814
-                urlsToStrings[0].indexOf("/commons-logging-1.") > 0);
433814
+                urlsToStrings[0].indexOf("/commons-logging-1.2-adapters.jar!") > 0);
433814
         assertTrue("Incorrect source for Log4JLogger class",
433814
-                urlsToStrings[1].indexOf("/commons-logging-adapters-1.") > 0);
433814
+                urlsToStrings[1].indexOf("/commons-logging-1.2.jar!") > 0);
433814
         
433814
     }
433814
 
433814
-- 
433814
2.5.5
433814