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