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 2007/07/17 00:31:04 UTC
svn commit: r556756 - in /maven/plugins/trunk/maven-assembly-plugin: ./
src/it/container-descriptors/custom-handler-withFileEntries/
src/it/container-descriptors/custom-handler-withFileEntries/assembly/
src/it/container-descriptors/custom-handler-withF...
Author: jdcasey
Date: Mon Jul 16 15:30:58 2007
New Revision: 556756
URL: http://svn.apache.org/viewvc?view=rev&rev=556756
Log:
Fixing filtering of file entries and mixed environments of files and fileSets.
Added:
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/a.properties (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/bin.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/file.txt (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/file.txt (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/goals.txt (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/components.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/verify.bsh
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/a.properties (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/bin.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/file.txt (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/file.txt (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/goals.txt (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/components.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/pom.xml (with props)
maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/verify.bsh
maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiverTest.java (with props)
Modified:
maven/plugins/trunk/maven-assembly-plugin/pom.xml
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiver.java
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java
Modified: maven/plugins/trunk/maven-assembly-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/pom.xml?view=diff&rev=556756&r1=556755&r2=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-assembly-plugin/pom.xml Mon Jul 16 15:30:58 2007
@@ -265,7 +265,7 @@
<!--
<debug>true</debug>
<pomIncludes>
- <pomInclude>container-descriptors/custom-containerDescriptorHandler/pom.xml</pomInclude>
+ <pomInclude>container-descriptors/custom-handler-withFileEntries/pom.xml</pomInclude>
</pomIncludes>
<streamLogs>true</streamLogs>
-->
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/a.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/a.properties?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/a.properties (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/a.properties Mon Jul 16 15:30:58 2007
@@ -0,0 +1 @@
+testProp=boo
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/a.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/a.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/pom.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/pom.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,44 @@
+<?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>
+ <parent>
+ <groupId>org.test</groupId>
+ <artifactId>custom-handler-withFileEntries</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>assembly</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>testing</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.test</groupId>
+ <artifactId>handler-def</artifactId>
+ <version>1</version>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <descriptors>
+ <descriptor>src/assemble/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/bin.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/bin.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/bin.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,28 @@
+<assembly>
+ <id>bin</id>
+
+ <formats>
+ <format>dir</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <files>
+ <file>
+ <source>src/config/a/file.txt</source>
+ <outputDirectory>a</outputDirectory>
+ <destName>file.txt</destName>
+ </file>
+ <file>
+ <source>src/config/b/file.txt</source>
+ <outputDirectory>b</outputDirectory>
+ <destName>file.txt</destName>
+ </file>
+ </files>
+
+ <containerDescriptorHandlers>
+ <containerDescriptorHandler>
+ <handlerName>file.txt</handlerName>
+ </containerDescriptorHandler>
+ </containerDescriptorHandlers>
+</assembly>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/bin.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/assemble/bin.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/file.txt?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/file.txt (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/file.txt Mon Jul 16 15:30:58 2007
@@ -0,0 +1 @@
+file A
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/file.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/a/file.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/file.txt?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/file.txt (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/file.txt Mon Jul 16 15:30:58 2007
@@ -0,0 +1,2 @@
+file B
+
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/file.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/assembly/src/config/b/file.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/goals.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/goals.txt?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/goals.txt (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/goals.txt Mon Jul 16 15:30:58 2007
@@ -0,0 +1 @@
+install
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/goals.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/goals.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/pom.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/pom.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,20 @@
+<?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>
+ <parent>
+ <groupId>org.test</groupId>
+ <artifactId>custom-handler-withFileEntries</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>handler-def</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>testing</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/components.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,14 @@
+<component-set>
+ <components>
+ <component>
+ <role>org.apache.maven.plugin.assembly.filter.ContainerDescriptorHandler</role>
+ <role-hint>file.txt</role-hint>
+ <implementation>org.apache.maven.plugin.assembly.filter.SimpleAggregatingDescriptorHandler</implementation>
+ <configuration>
+ <filePattern>.*file.txt</filePattern>
+ <outputPath>file.txt</outputPath>
+ <commentChars>#</commentChars>
+ </configuration>
+ </component>
+ </components>
+</component-set>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/handler-def/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/pom.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/pom.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,14 @@
+<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>org.test</groupId>
+ <artifactId>custom-handler-withFileEntries</artifactId>
+ <packaging>pom</packaging>
+ <version>1</version>
+ <name>custom-handler-withFileEntries</name>
+
+ <modules>
+ <module>handler-def</module>
+ <module>assembly</module>
+ </modules>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/verify.bsh?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/verify.bsh (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withFileEntries/verify.bsh Mon Jul 16 15:30:58 2007
@@ -0,0 +1,54 @@
+import java.io.*;
+
+boolean result = true;
+
+try
+{
+ File a = new File( basedir, "assembly/target/assembly-1-bin.dir/file.txt");
+ File b = new File( basedir, "assembly/target/assembly-1-bin.dir/b/file.txt");
+
+ if(result && !a.exists() ) {
+ System.out.println( "File: " + a + " should have been generated, but was not." );
+ result = false;
+ }
+
+ if(result) {
+ BufferedReader r = new BufferedReader(new FileReader(a));
+ String s = null;
+
+ boolean foundA = false;
+ boolean foundB = false;
+ while( ( s = r.readLine() ) != null )
+ {
+ if ( s.equals( "file A" ) ) {
+ foundA = true;
+ }
+ else if ( s.equals( "file B" ) ) {
+ foundB = true;
+ }
+
+ if ( foundA && foundB )
+ {
+ result = true;
+ break;
+ }
+ }
+
+ if ( !result )
+ {
+ System.out.println( "File: " + a + " should contain lines:\nfile A\nfile B\n\n ...but didn't." );
+ }
+ }
+
+ if(result && b.exists() ) {
+ System.out.println( "File: " + b + " should not exist, but does." );
+ result = false;
+ }
+}
+catch( IOException e )
+{
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/a.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/a.properties?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/a.properties (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/a.properties Mon Jul 16 15:30:58 2007
@@ -0,0 +1 @@
+testProp=boo
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/a.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/a.properties
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/pom.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/pom.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,44 @@
+<?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>
+ <parent>
+ <groupId>org.test</groupId>
+ <artifactId>custom-handler-withMixedEntries</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>assembly</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>testing</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.test</groupId>
+ <artifactId>handler-def</artifactId>
+ <version>1</version>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <descriptors>
+ <descriptor>src/assemble/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/bin.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/bin.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/bin.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,30 @@
+<assembly>
+ <id>bin</id>
+
+ <formats>
+ <format>dir</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <files>
+ <file>
+ <source>src/config/a/file.txt</source>
+ <outputDirectory>a</outputDirectory>
+ <destName>file.txt</destName>
+ </file>
+ </files>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/config/b</directory>
+ <outputDirectory>b</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+ <containerDescriptorHandlers>
+ <containerDescriptorHandler>
+ <handlerName>file.txt</handlerName>
+ </containerDescriptorHandler>
+ </containerDescriptorHandlers>
+</assembly>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/bin.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/assemble/bin.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/file.txt?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/file.txt (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/file.txt Mon Jul 16 15:30:58 2007
@@ -0,0 +1 @@
+file A
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/file.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/a/file.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/file.txt?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/file.txt (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/file.txt Mon Jul 16 15:30:58 2007
@@ -0,0 +1,2 @@
+file B
+
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/file.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/assembly/src/config/b/file.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/goals.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/goals.txt?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/goals.txt (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/goals.txt Mon Jul 16 15:30:58 2007
@@ -0,0 +1 @@
+install
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/goals.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/goals.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/pom.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/pom.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,20 @@
+<?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>
+ <parent>
+ <groupId>org.test</groupId>
+ <artifactId>custom-handler-withMixedEntries</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>handler-def</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>testing</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/components.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,14 @@
+<component-set>
+ <components>
+ <component>
+ <role>org.apache.maven.plugin.assembly.filter.ContainerDescriptorHandler</role>
+ <role-hint>file.txt</role-hint>
+ <implementation>org.apache.maven.plugin.assembly.filter.SimpleAggregatingDescriptorHandler</implementation>
+ <configuration>
+ <filePattern>.*file.txt</filePattern>
+ <outputPath>file.txt</outputPath>
+ <commentChars>#</commentChars>
+ </configuration>
+ </component>
+ </components>
+</component-set>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/handler-def/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/pom.xml?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/pom.xml (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/pom.xml Mon Jul 16 15:30:58 2007
@@ -0,0 +1,14 @@
+<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>org.test</groupId>
+ <artifactId>custom-handler-withMixedEntries</artifactId>
+ <packaging>pom</packaging>
+ <version>1</version>
+ <name>custom-handler-withMixedEntries</name>
+
+ <modules>
+ <module>handler-def</module>
+ <module>assembly</module>
+ </modules>
+</project>
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/verify.bsh?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/verify.bsh (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/container-descriptors/custom-handler-withMixedEntries/verify.bsh Mon Jul 16 15:30:58 2007
@@ -0,0 +1,54 @@
+import java.io.*;
+
+boolean result = true;
+
+try
+{
+ File a = new File( basedir, "assembly/target/assembly-1-bin.dir/file.txt");
+ File b = new File( basedir, "assembly/target/assembly-1-bin.dir/b/file.txt");
+
+ if(result && !a.exists() ) {
+ System.out.println( "File: " + a + " should have been generated, but was not." );
+ result = false;
+ }
+
+ if(result) {
+ BufferedReader r = new BufferedReader(new FileReader(a));
+ String s = null;
+
+ boolean foundA = false;
+ boolean foundB = false;
+ while( ( s = r.readLine() ) != null )
+ {
+ if ( s.equals( "file A" ) ) {
+ foundA = true;
+ }
+ else if ( s.equals( "file B" ) ) {
+ foundB = true;
+ }
+
+ if ( foundA && foundB )
+ {
+ result = true;
+ break;
+ }
+ }
+
+ if ( !result )
+ {
+ System.out.println( "File: " + a + " should contain lines:\nfile A\nfile B\n\n ...but didn't." );
+ }
+ }
+
+ if(result && b.exists() ) {
+ System.out.println( "File: " + b + " should not exist, but does." );
+ result = false;
+ }
+}
+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/archiver/PrefixingProxyArchiver.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiver.java?view=diff&rev=556756&r1=556755&r2=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiver.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiver.java Mon Jul 16 15:30:58 2007
@@ -31,6 +31,8 @@
private FileSelector[] selectors;
+ private ThreadLocal inPublicApi = new ThreadLocal();
+
public PrefixingProxyArchiver( String rootPrefix, Archiver delegate, List containerDescriptorHandlers,
List extraSelectors, List extraFinalizers )
{
@@ -87,105 +89,169 @@
public void addArchivedFileSet( File archiveFile, String prefix, String[] includes, String[] excludes )
throws ArchiverException
{
- DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
- fs.setArchive( archiveFile );
- fs.setIncludes( includes );
- fs.setExcludes( excludes );
- fs.setPrefix( rootPrefix + prefix );
- fs.setFileSelectors( selectors );
+ fs.setArchive( archiveFile );
+ fs.setIncludes( includes );
+ fs.setExcludes( excludes );
+ fs.setPrefix( rootPrefix + prefix );
+ fs.setFileSelectors( selectors );
- delegate.addArchivedFileSet( fs );
+ delegate.addArchivedFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addArchivedFileSet( File archiveFile, String prefix )
throws ArchiverException
{
- DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
- fs.setArchive( archiveFile );
- fs.setPrefix( rootPrefix + prefix );
- fs.setFileSelectors( selectors );
+ fs.setArchive( archiveFile );
+ fs.setPrefix( rootPrefix + prefix );
+ fs.setFileSelectors( selectors );
- delegate.addArchivedFileSet( fs );
+ delegate.addArchivedFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addArchivedFileSet( File archiveFile, String[] includes, String[] excludes )
throws ArchiverException
{
- DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
- fs.setArchive( archiveFile );
- fs.setIncludes( includes );
- fs.setExcludes( excludes );
- fs.setPrefix( rootPrefix );
- fs.setFileSelectors( selectors );
+ fs.setArchive( archiveFile );
+ fs.setIncludes( includes );
+ fs.setExcludes( excludes );
+ fs.setPrefix( rootPrefix );
+ fs.setFileSelectors( selectors );
- delegate.addArchivedFileSet( fs );
+ delegate.addArchivedFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addArchivedFileSet( File archiveFile )
throws ArchiverException
{
- DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultArchivedFileSet fs = new DefaultArchivedFileSet();
- fs.setArchive( archiveFile );
- fs.setPrefix( rootPrefix );
- fs.setFileSelectors( selectors );
+ fs.setArchive( archiveFile );
+ fs.setPrefix( rootPrefix );
+ fs.setFileSelectors( selectors );
- delegate.addArchivedFileSet( fs );
+ delegate.addArchivedFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addDirectory( File directory, String prefix, String[] includes, String[] excludes )
throws ArchiverException
{
- DefaultFileSet fs = new DefaultFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultFileSet fs = new DefaultFileSet();
- fs.setDirectory( directory );
- fs.setIncludes( includes );
- fs.setExcludes( excludes );
- fs.setPrefix( rootPrefix + prefix );
- fs.setFileSelectors( selectors );
+ fs.setDirectory( directory );
+ fs.setIncludes( includes );
+ fs.setExcludes( excludes );
+ fs.setPrefix( rootPrefix + prefix );
+ fs.setFileSelectors( selectors );
- delegate.addFileSet( fs );
+ delegate.addFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addDirectory( File directory, String prefix )
throws ArchiverException
{
- DefaultFileSet fs = new DefaultFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultFileSet fs = new DefaultFileSet();
- fs.setDirectory( directory );
- fs.setPrefix( rootPrefix + prefix );
- fs.setFileSelectors( selectors );
+ fs.setDirectory( directory );
+ fs.setPrefix( rootPrefix + prefix );
+ fs.setFileSelectors( selectors );
- delegate.addFileSet( fs );
+ delegate.addFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addDirectory( File directory, String[] includes, String[] excludes )
throws ArchiverException
{
- DefaultFileSet fs = new DefaultFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultFileSet fs = new DefaultFileSet();
- fs.setDirectory( directory );
- fs.setIncludes( includes );
- fs.setExcludes( excludes );
- fs.setPrefix( rootPrefix );
- fs.setFileSelectors( selectors );
+ fs.setDirectory( directory );
+ fs.setIncludes( includes );
+ fs.setExcludes( excludes );
+ fs.setPrefix( rootPrefix );
+ fs.setFileSelectors( selectors );
- delegate.addFileSet( fs );
+ delegate.addFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addDirectory( File directory )
throws ArchiverException
{
- DefaultFileSet fs = new DefaultFileSet();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ DefaultFileSet fs = new DefaultFileSet();
- fs.setDirectory( directory );
- fs.setPrefix( rootPrefix );
- fs.setFileSelectors( selectors );
+ fs.setDirectory( directory );
+ fs.setPrefix( rootPrefix );
+ fs.setFileSelectors( selectors );
- delegate.addFileSet( fs );
+ delegate.addFileSet( fs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addFile( File inputFile, String destFileName, int permissions )
@@ -193,7 +259,17 @@
{
if ( acceptFile( inputFile ) )
{
- delegate.addFile( inputFile, rootPrefix + destFileName, permissions );
+ System.out.println( "File: " + inputFile + " was accepted by selectors." );
+
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.addFile( inputFile, rootPrefix + destFileName, permissions );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
}
@@ -202,113 +278,255 @@
{
if ( acceptFile( inputFile ) )
{
- delegate.addFile( inputFile, rootPrefix + destFileName );
+ System.out.println( "File: " + inputFile + " was accepted by selectors." );
+
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.addFile( inputFile, rootPrefix + destFileName );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
}
public void createArchive()
throws ArchiverException, IOException
{
- delegate.createArchive();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.createArchive();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public int getDefaultDirectoryMode()
{
- return delegate.getDefaultDirectoryMode();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ return delegate.getDefaultDirectoryMode();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public int getDefaultFileMode()
{
- return delegate.getDefaultFileMode();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ return delegate.getDefaultFileMode();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public File getDestFile()
{
- return delegate.getDestFile();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ return delegate.getDestFile();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public Map getFiles()
{
- return delegate.getFiles();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ return delegate.getFiles();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public boolean getIncludeEmptyDirs()
{
- return delegate.getIncludeEmptyDirs();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ return delegate.getIncludeEmptyDirs();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public boolean isForced()
{
- return delegate.isForced();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ return delegate.isForced();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public boolean isSupportingForced()
{
- return delegate.isSupportingForced();
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ return delegate.isSupportingForced();
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void setDefaultDirectoryMode( int mode )
{
- delegate.setDefaultDirectoryMode( mode );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.setDefaultDirectoryMode( mode );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void setDefaultFileMode( int mode )
{
- delegate.setDefaultFileMode( mode );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.setDefaultFileMode( mode );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void setDestFile( File destFile )
{
- delegate.setDestFile( destFile );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.setDestFile( destFile );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void setForced( boolean forced )
{
- delegate.setForced( forced );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.setForced( forced );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void setIncludeEmptyDirs( boolean includeEmptyDirs )
{
- delegate.setIncludeEmptyDirs( includeEmptyDirs );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.setIncludeEmptyDirs( includeEmptyDirs );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void setDotFileDirectory( File dotFileDirectory )
{
- throw new UnsupportedOperationException( "Undocumented feature of plexus-archiver; this is not yet supported." );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ throw new UnsupportedOperationException(
+ "Undocumented feature of plexus-archiver; this is not yet supported." );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addArchivedFileSet( ArchivedFileSet fileSet )
throws ArchiverException
{
- delegate.addArchivedFileSet( new PrefixedArchivedFileSet( fileSet, rootPrefix, selectors ) );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.addArchivedFileSet( new PrefixedArchivedFileSet( fileSet, rootPrefix, selectors ) );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
public void addFileSet( FileSet fileSet )
throws ArchiverException
{
- delegate.addFileSet( new PrefixedFileSet( fileSet, rootPrefix, selectors ) );
+ inPublicApi.set( Boolean.TRUE );
+ try
+ {
+ delegate.addFileSet( new PrefixedFileSet( fileSet, rootPrefix, selectors ) );
+ }
+ finally
+ {
+ inPublicApi.set( null );
+ }
}
private boolean acceptFile( File inputFile )
throws ArchiverException
{
- if ( selectors != null )
+ if ( Boolean.TRUE != inPublicApi.get() )
{
- FileInfo fileInfo = new DefaultFileInfo( inputFile );
-
- for ( int i = 0; i < selectors.length; i++ )
+ if ( selectors != null )
{
- try
+ FileInfo fileInfo = new DefaultFileInfo( inputFile );
+
+ for ( int i = 0; i < selectors.length; i++ )
{
- if ( !selectors[i].isSelected( fileInfo ) )
+ try
{
- return false;
+ if ( !selectors[i].isSelected( fileInfo ) )
+ {
+ return false;
+ }
+ }
+ catch ( IOException e )
+ {
+ throw new ArchiverException( "Error processing file: " + inputFile + " using selector: "
+ + selectors[i], e );
}
- }
- catch ( IOException e )
- {
- throw new ArchiverException( "Error processing file: " + inputFile + " using selector: "
- + selectors[i], e );
}
}
}
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java?view=diff&rev=556756&r1=556755&r2=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/SimpleAggregatingDescriptorHandler.java Mon Jul 16 15:30:58 2007
@@ -125,6 +125,7 @@
System.out.println( "\n\nChecking isSelected(..) for file with name: " + fileInfo.getName() + "\nin: " + getClass().getName() + "\n\n" );
if ( overrideFilterAction )
{
+ System.out.println( "Filtering overridden. Returning true." );
return true;
}
@@ -132,12 +133,14 @@
if ( fileInfo.isFile() && name.matches( filePattern ) )
{
+ System.out.println( "File is filtered. Processing, and returning false to suppress original file's inclusion." );
readProperties( fileInfo );
filenames.add( name );
return false;
}
+ System.out.println( "File does not match filter pattern. Return true to allow its inclusion as-is." );
return true;
}
Added: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiverTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiverTest.java?view=auto&rev=556756
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiverTest.java (added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiverTest.java Mon Jul 16 15:30:58 2007
@@ -0,0 +1,110 @@
+package org.apache.maven.plugin.assembly.archive.archiver;
+
+import org.apache.maven.plugin.assembly.testutils.TestFileManager;
+import org.codehaus.plexus.archiver.Archiver;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.components.io.fileselectors.FileInfo;
+import org.codehaus.plexus.components.io.fileselectors.FileSelector;
+import org.easymock.MockControl;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+public class PrefixingProxyArchiverTest
+ extends TestCase
+{
+
+ private TestFileManager fileManager = new TestFileManager( "massembly-proxyArchiver", "" );
+
+ public void tearDown()
+ throws Exception
+ {
+ fileManager.cleanUp();
+ }
+
+ public void testAddFile_NoPerms_CallAcceptFilesOnlyOnce()
+ throws IOException, ArchiverException
+ {
+ MockControl delegateControl = MockControl.createControl( Archiver.class );
+ Archiver delegate = (Archiver) delegateControl.getMock();
+
+ delegate.addFile( null, null );
+ delegateControl.setMatcher( MockControl.ALWAYS_MATCHER );
+ delegateControl.setVoidCallable();
+
+ CounterSelector counter = new CounterSelector( true );
+ List selectors = Collections.singletonList( counter );
+
+ delegateControl.replay();
+
+ PrefixingProxyArchiver archiver = new PrefixingProxyArchiver( "", delegate, Collections.EMPTY_LIST, selectors,
+ Collections.EMPTY_LIST );
+
+ File inputFile = fileManager.createTempFile();
+
+ archiver.addFile( inputFile, "file.txt" );
+
+ assertEquals( 1, counter.getCount() );
+
+ delegateControl.verify();
+ }
+
+ public void testAddDirectory_NoPerms_CallAcceptFilesOnlyOnce()
+ throws IOException, ArchiverException
+ {
+ Archiver delegate = new JarArchiver();
+
+ File output = fileManager.createTempFile();
+ delegate.setDestFile( output );
+
+ CounterSelector counter = new CounterSelector( false );
+ List selectors = Collections.singletonList( counter );
+
+ PrefixingProxyArchiver archiver = new PrefixingProxyArchiver( "", delegate, Collections.EMPTY_LIST, selectors,
+ Collections.EMPTY_LIST );
+
+ File dir = fileManager.createTempDir();
+ fileManager.createFile( dir, "file.txt", "This is a test." );
+
+ archiver.addDirectory( dir );
+
+ assertEquals( 1, counter.getCount() );
+ }
+
+ private static final class CounterSelector
+ implements FileSelector
+ {
+
+ private int count = 0;
+
+ private boolean answer = false;
+
+ public CounterSelector( boolean answer )
+ {
+ this.answer = answer;
+ }
+
+ public int getCount()
+ {
+ return count;
+ }
+
+ public boolean isSelected( FileInfo fileInfo )
+ throws IOException
+ {
+ if ( fileInfo.isFile() )
+ {
+ count++;
+ }
+
+ return answer;
+ }
+
+ }
+
+}
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiverTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugin/assembly/archive/archiver/PrefixingProxyArchiverTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"