You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2006/08/11 01:29:30 UTC
svn commit: r430590 - in /maven/plugins/trunk/maven-assembly-plugin/src:
it/multimodule/two-level-multimodule/
it/multimodule/two-level-multimodule/child-level1-project1/
it/multimodule/two-level-multimodule/child-level1-project1/src/
it/multimodule/tw...
Author: jdcasey
Date: Thu Aug 10 16:29:29 2006
New Revision: 430590
URL: http://svn.apache.org/viewvc?rev=430590&view=rev
Log:
[MASSEMBLY-117][MASSEMBLY-109] Verified that multi-tiered multimodule support is handled.
Added:
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/App.java (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/AppTest.java (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/App.java (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/AppTest.java (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/goals.txt (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/bin.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/verify.bsh
Modified:
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java
maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/pom.xml?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/pom.xml Thu Aug 10 16:29:29 2006
@@ -0,0 +1,19 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <groupId>test</groupId>
+ <artifactId>two-level-multimodule</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>child-level1-project1</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/App.java?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/App.java (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/App.java Thu Aug 10 16:29:29 2006
@@ -0,0 +1,13 @@
+package test;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/main/java/test/App.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/AppTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/AppTest.java?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/AppTest.java (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/AppTest.java Thu Aug 10 16:29:29 2006
@@ -0,0 +1,38 @@
+package test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/AppTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project1/src/test/java/test/AppTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/pom.xml?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/pom.xml Thu Aug 10 16:29:29 2006
@@ -0,0 +1,19 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>child-level1-project2</artifactId>
+ <groupId>test</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>child-level2-project1</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/App.java?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/App.java (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/App.java Thu Aug 10 16:29:29 2006
@@ -0,0 +1,13 @@
+package test;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/main/java/test/App.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/AppTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/AppTest.java?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/AppTest.java (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/AppTest.java Thu Aug 10 16:29:29 2006
@@ -0,0 +1,38 @@
+package test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/AppTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/child-level2-project1/src/test/java/test/AppTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/pom.xml?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/pom.xml Thu Aug 10 16:29:29 2006
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <parent>
+ <groupId>test</groupId>
+ <artifactId>two-level-multimodule</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>child-level1-project2</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>child-level2-project1</module>
+ </modules>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/child-level1-project2/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/goals.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/goals.txt?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/goals.txt (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/goals.txt Thu Aug 10 16:29:29 2006
@@ -0,0 +1 @@
+package assembly:directory
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/goals.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/goals.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/pom.xml?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/pom.xml Thu Aug 10 16:29:29 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>two-level-multimodule</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>child-level1-project1</module>
+ <module>child-level1-project2</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assemble/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/bin.xml?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/bin.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/bin.xml Thu Aug 10 16:29:29 2006
@@ -0,0 +1,16 @@
+
+<assembly>
+ <id>bin</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <moduleSets>
+ <moduleSet>
+ <binaries>
+ <outputDirectory>modules</outputDirectory>
+ <unpack>false</unpack>
+ </binaries>
+ </moduleSet>
+ </moduleSets>
+</assembly>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/bin.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/src/assemble/bin.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/verify.bsh?rev=430590&view=auto
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/verify.bsh (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/multimodule/two-level-multimodule/verify.bsh Thu Aug 10 16:29:29 2006
@@ -0,0 +1,18 @@
+import java.io.*;
+import java.net.*;
+import java.util.jar.*;
+
+boolean result = true;
+
+try
+{
+ result = new File( basedir, "target/two-level-multimodule-1.0-SNAPSHOT-bin.dir/modules/child-level1-project1-1.0-SNAPSHOT.jar" ).exists();
+ result = result && new File( basedir, "target/two-level-multimodule-1.0-SNAPSHOT-bin.dir/modules/child-level2-project1-1.0-SNAPSHOT.jar" ).exists();
+}
+catch( IOException e )
+{
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java?rev=430590&r1=430589&r2=430590&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhase.java Thu Aug 10 16:29:29 2006
@@ -1,6 +1,7 @@
package org.apache.maven.plugin.assembly.archive.phase;
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugin.assembly.archive.task.AddArtifactTask;
@@ -79,7 +80,7 @@
}
}
- protected void addModuleBinaries( ModuleBinaries binaries, Set moduleProjects, Archiver archiver,
+ protected void addModuleBinaries( ModuleBinaries binaries, Set projects, Archiver archiver,
AssemblerConfigurationSource configSource, boolean includeBaseDirectory )
throws ArchiveCreationException, AssemblyFormattingException
{
@@ -87,6 +88,22 @@
{
return;
}
+
+ Set moduleProjects = new HashSet( projects );
+
+ for ( Iterator it = moduleProjects.iterator(); it.hasNext(); )
+ {
+ MavenProject project = ( MavenProject ) it.next();
+
+ if ( "pom".equals( project.getPackaging() ) )
+ {
+ String projectId = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );
+
+ getLogger().debug( "Excluding POM-packaging module: " + projectId );
+
+ it.remove();
+ }
+ }
Set visitedArtifacts = new HashSet();
@@ -119,10 +136,8 @@
List includes = binaries.getIncludes();
- // we don't need to include dependencies which have already been found.
-// List excludes = collectExcludesFromQueuedArtifacts( visitedArtifacts, binaries.getExcludes() );
List excludes = binaries.getExcludes();
-
+
FilterUtils.filterArtifacts( binaryDependencies, includes, excludes, true, Collections.EMPTY_LIST,
getLogger() );
Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java?rev=430590&r1=430589&r2=430590&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/phase/ModuleSetAssemblyPhaseTest.java Thu Aug 10 16:29:29 2006
@@ -61,20 +61,20 @@
throws ArchiveCreationException, AssemblyFormattingException, IOException
{
MockManager mm = new MockManager();
-
+
MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask( mm );
-
+
MavenProject project = createProject( "group", "artifact", "version", null );
MavenProject module = createProject( "group", "module", "version", project );
-
+
macTask.expectArtifactGetFile();
module.setArtifact( macTask.artifact );
-
+
List projects = new ArrayList();
-
+
projects.add( project );
projects.add( module );
-
+
macTask.expectGetProject( project );
macTask.expectGetReactorProjects( projects );
macTask.expectGetFinalName( "final-name" );
@@ -83,32 +83,32 @@
macTask.expectArtifactGetDependencyConflictId( "group:module:jar" );
int mode = Integer.parseInt( "777", 8 );
-
+
macTask.expectAddFile( "out/artifact", mode );
-
+
Assembly assembly = new Assembly();
assembly.setIncludeBaseDirectory( false );
-
+
ModuleSet ms = new ModuleSet();
-
+
ModuleBinaries bin = new ModuleBinaries();
-
+
bin.setOutputFileNameMapping( "artifact" );
bin.setOutputDirectory( "out" );
bin.setFileMode( "777" );
bin.setUnpack( false );
bin.setIncludeDependencies( false );
-
+
ms.setBinaries( bin );
-
+
assembly.addModuleSet( ms );
-
+
Logger logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
-
+
mm.replayAll();
createPhase( logger, null ).execute( assembly, macTask.archiver, macTask.configSource );
-
+
mm.verifyAll();
}
@@ -118,15 +118,44 @@
createPhase( null, null ).addModuleBinaries( null, null, null, null, false );
}
+ public void testAddModuleBinaries_ShouldFilterPomModule()
+ throws ArchiveCreationException, AssemblyFormattingException, IOException
+ {
+ MockManager mm = new MockManager();
+
+ MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask( mm );
+
+ ModuleBinaries binaries = new ModuleBinaries();
+
+ binaries.setIncludeDependencies( false );
+ binaries.setUnpack( false );
+ binaries.setFileMode( "777" );
+ binaries.setOutputDirectory( "out" );
+ binaries.setOutputFileNameMapping( "artifact" );
+
+ MavenProject project = createProject( "group", "artifact", "version", null );
+ project.setPackaging( "pom" );
+ project.setArtifact( macTask.artifact );
+
+ Set projects = Collections.singleton( project );
+
+ mm.replayAll();
+
+ createPhase( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ), null ).addModuleBinaries( binaries, projects, macTask.archiver,
+ macTask.configSource, false );
+
+ mm.verifyAll();
+ }
+
public void testAddModuleBinaries_ShouldAddOneModuleArtifactAndNoDeps()
throws ArchiveCreationException, AssemblyFormattingException, IOException
{
MockManager mm = new MockManager();
MockAndControlForLogger macLogger = new MockAndControlForLogger( mm );
-
+
macLogger.expectDebug( false, true );
-
+
MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask( mm );
macTask.expectArtifactGetFile( true );
@@ -435,11 +464,11 @@
false );
mm.replayAll();
-
+
Logger logger = new ConsoleLogger( Logger.LEVEL_DEBUG, "test" );
- createPhase( logger, null ).addModuleSourceFileSets( sources, projects, macTask.archiver,
- macTask.configSource, false );
+ createPhase( logger, null ).addModuleSourceFileSets( sources, projects, macTask.archiver, macTask.configSource,
+ false );
mm.verifyAll();
}