maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r550521 - in /maven/plugins/trunk/maven-assembly-plugin/src: it/dependency-sets/dependencySet-unpacked/child2/src/assemble/ it/dependency-sets/dependencySet-unpackedExcludingMetaInf/child2/src/assemble/ it/dependency-sets/including-pom-depe...
Date Mon, 25 Jun 2007 14:49:03 GMT
Author: jdcasey
Date: Mon Jun 25 07:49:02 2007
New Revision: 550521

URL: http://svn.apache.org/viewvc?view=rev&rev=550521
Log:
[MASSEMBLY-179] <outputFileNameMapping/> now only works with non-unpacked artifacts.

Modified:
    maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpacked/child2/src/assemble/bin.xml
    maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpackedExcludingMetaInf/child2/src/assemble/bin.xml
    maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/src/assemble/bin.xml
    maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/verify.bsh
    maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/src/assemble/bin.xml
    maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/verify.bsh
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java
    maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTaskTest.java
    maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTaskTest.java

Modified: maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpacked/child2/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpacked/child2/src/assemble/bin.xml?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpacked/child2/src/assemble/bin.xml
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpacked/child2/src/assemble/bin.xml
Mon Jun 25 07:49:02 2007
@@ -10,8 +10,7 @@
         <include>test:child1</include>
       </includes>
       <unpack>true</unpack>
-      <outputDirectory>/</outputDirectory>
-      <outputFileNameMapping>${artifactId}</outputFileNameMapping>
+      <outputDirectory>/${artifactId}</outputDirectory>
       <scope>test</scope>
       <excludes>
         <exclude>junit:junit</exclude>

Modified: maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpackedExcludingMetaInf/child2/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpackedExcludingMetaInf/child2/src/assemble/bin.xml?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpackedExcludingMetaInf/child2/src/assemble/bin.xml
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/dependencySet-unpackedExcludingMetaInf/child2/src/assemble/bin.xml
Mon Jun 25 07:49:02 2007
@@ -15,8 +15,7 @@
           <exclude>META-INF/**</exclude>
         </excludes>
       </unpackOptions>
-      <outputDirectory>/</outputDirectory>
-      <outputFileNameMapping>${artifactId}</outputFileNameMapping>
+      <outputDirectory>/${artifactId}</outputDirectory>
       <scope>test</scope>
       <excludes>
         <exclude>junit:junit</exclude>

Modified: maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/src/assemble/bin.xml?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/src/assemble/bin.xml
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/src/assemble/bin.xml
Mon Jun 25 07:49:02 2007
@@ -6,9 +6,19 @@
   <includeBaseDirectory>false</includeBaseDirectory>
   <dependencySets>
     <dependencySet>
-      <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
+      <outputDirectory>lib/${artifactId}</outputDirectory>
+      <unpack>true</unpack>
+      <excludes>
+        <exclude>*:pom</exclude>
+      </excludes>
+    </dependencySet>
+    <dependencySet>
       <outputDirectory>lib</outputDirectory>
+      <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
       <unpack>true</unpack>
+      <includes>
+        <include>*:pom</include>
+      </includes>
     </dependencySet>
   </dependencySets>
 </assembly>

Modified: maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/verify.bsh?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/verify.bsh
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-pom-dependency/verify.bsh
Mon Jun 25 07:49:02 2007
@@ -3,14 +3,14 @@
 boolean result = true;
 
 // verify that transitive deps of the POM dep were included.
-result = result && new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-utils.jar"
).exists();
-result = result && new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/classworlds.jar"
).exists();
-result = result && new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/junit.jar"
).exists();
+result = result && new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-utils"
).exists();
+result = result && new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/classworlds"
).exists();
+result = result && new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/junit"
).exists();
 
 // verify that the POM dep was included without extracting.
 result = result && new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-container-default.pom"
).exists();
 
 // verify that the jar associated with the POM dep wasn't included either.
-result = result && !new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-container-default.jar"
).exists();
+result = result && !new File( basedir, "target/including-pom-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-container-default"
).exists();
 
 return result;

Modified: maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/src/assemble/bin.xml?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/src/assemble/bin.xml
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/src/assemble/bin.xml
Mon Jun 25 07:49:02 2007
@@ -6,8 +6,7 @@
   <includeBaseDirectory>false</includeBaseDirectory>
   <dependencySets>
     <dependencySet>
-      <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
-      <outputDirectory>lib</outputDirectory>
+      <outputDirectory>lib/${artifactId}</outputDirectory>
       <unpack>true</unpack>
     </dependencySet>
   </dependencySets>

Modified: maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/verify.bsh?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/verify.bsh
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/dependency-sets/including-sar-dependency/verify.bsh
Mon Jun 25 07:49:02 2007
@@ -3,9 +3,9 @@
 boolean result = true;
 
 // verify that transitive deps of the POM dep were included.
-result = result && new File( basedir, "target/including-sar-dependency-1.0-SNAPSHOT-bin.dir/lib/xmlrpc.jar"
).exists();
-result = result && new File( basedir, "target/including-sar-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-xmlrpc.jar"
).exists();
+result = result && new File( basedir, "target/including-sar-dependency-1.0-SNAPSHOT-bin.dir/lib/xmlrpc"
).exists();
+result = result && new File( basedir, "target/including-sar-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-xmlrpc"
).exists();
 
-result = result && new File( basedir, "target/including-sar-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-appserver-service-xmlrpc.sar/lib/commons-codec-1.3.jar"
).exists();
+result = result && new File( basedir, "target/including-sar-dependency-1.0-SNAPSHOT-bin.dir/lib/plexus-appserver-service-xmlrpc/lib/commons-codec-1.3.jar"
).exists();
 
 return result;

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTask.java
Mon Jun 25 07:49:02 2007
@@ -51,12 +51,10 @@
 
         destDirectory = AssemblyFormatUtils.getOutputDirectory( destDirectory, project, configSource.getFinalName()
);
 
-        String fileNameMapping = AssemblyFormatUtils.evaluateFileNameMapping( outputFileNameMapping,
artifact );
-
-        String outputLocation = destDirectory + fileNameMapping;
-
         if ( unpack )
         {
+            String outputLocation = destDirectory;
+
             if ( ( outputLocation.length() > 0 ) && !outputLocation.endsWith(
"/" ) )
             {
                 outputLocation += "/";
@@ -107,6 +105,10 @@
         }
         else
         {
+            String fileNameMapping = AssemblyFormatUtils.evaluateFileNameMapping( outputFileNameMapping,
artifact );
+
+            String outputLocation = destDirectory + fileNameMapping;
+
             try
             {
                 if ( fileMode != null )

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTaskTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTaskTest.java?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTaskTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddArtifactTaskTest.java
Mon Jun 25 07:49:02 2007
@@ -20,18 +20,17 @@
 {
 
     private MockManager mockManager;
-    
+
     private MockAndControlForAddArtifactTask mac;
 
     public void setUp()
         throws IOException
     {
         mockManager = new MockManager();
-        
+
         mac = new MockAndControlForAddArtifactTask( mockManager );
         mac.expectArtifactGetFile();
         mac.expectGetFinalName( "final-name" );
-        mac.expectGetArtifactHandler();
     }
 
     public void testShouldAddArchiveFileWithoutUnpacking()
@@ -41,6 +40,7 @@
 
         mac.expectAddFile( outputLocation );
         mac.expectIsSnapshot( false );
+        mac.expectGetArtifactHandler();
         mockManager.replayAll();
 
         AddArtifactTask task = createTask( mac.artifact );
@@ -63,9 +63,9 @@
         throws ArchiveCreationException, AssemblyFormattingException
     {
         mac.expectModeChange( -1, -1, -1, -1, 1 );
-        mac.expectIsSnapshot( false );
+//        mac.expectIsSnapshot( false );
 
-        String outputLocation = "artifact/";
+        String outputLocation = "";
 
         try
         {
@@ -92,11 +92,11 @@
     {
         int directoryMode = TypeConversionUtils.modeToInt( "777", new ConsoleLogger( Logger.LEVEL_DEBUG,
"test" ) );
         int fileMode = TypeConversionUtils.modeToInt( "777", new ConsoleLogger( Logger.LEVEL_DEBUG,
"test" ) );
-        
+
         mac.expectModeChange( -1, -1, directoryMode, fileMode, 2 );
-        mac.expectIsSnapshot( false );
+//        mac.expectIsSnapshot( false );
 
-        String outputLocation = "artifact/";
+        String outputLocation = "";
 
         try
         {
@@ -124,9 +124,8 @@
         throws ArchiveCreationException, AssemblyFormattingException
     {
         mac.expectModeChange( -1, -1, -1, -1, 1 );
-        mac.expectIsSnapshot( false );
 
-        String outputLocation = "artifact/";
+        String outputLocation = "";
 
         String[] includes = { "**/*.txt" };
         String[] excludes = { "**/README.txt" };

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTaskTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTaskTest.java?view=diff&rev=550521&r1=550520&r2=550521
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTaskTest.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTaskTest.java
Mon Jun 25 07:49:02 2007
@@ -81,20 +81,20 @@
 
         macTask.expectArtifactGetFile();
         macTask.expectArtifactGetType( "jar" );
-        macTask.expectIsSnapshot( false );
-        macTask.expectGetArtifactHandler();
 
         macTask.expectCSGetRepositories( null, null );
         macTask.expectResolveDependencies( Collections.singleton( macTask.artifact ) );
 
         if ( unpack )
         {
-            macTask.expectAddArchivedFileSet( outputLocation + "/artifact/", null, null );
+            macTask.expectAddArchivedFileSet( outputLocation + "/", null, null );
             macTask.expectModeChange( -1, -1, 10, 10, 2 );
         }
         else
         {
             macTask.expectAddFile( outputLocation + "/artifact", 10 );
+            macTask.expectIsSnapshot( false );
+            macTask.expectGetArtifactHandler();
         }
 
         macTask.expectCSGetFinalName( "final-name" );



Mime
View raw message