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