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