maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From belling...@apache.org
Subject svn commit: r555968 - in /maven/plugins/trunk/maven-assembly-plugin/src: it/filtering-feature/ it/filtering-feature/filtersDefinedInAssemblyPluginConfig/ it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/ it/filtering-feature/filtersDefined...
Date Fri, 13 Jul 2007 12:24:11 GMT
Author: bellingard
Date: Fri Jul 13 05:24:10 2007
New Revision: 555968

URL: http://svn.apache.org/viewvc?view=rev&rev=555968
Log:
[MASSEMBLY-226] Filters as read-only parameter can break the assembly build of a multi-module
project

Added:
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/filter.properties
  (with props)
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/goals.txt
  (with props)
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/pom.xml
  (with props)
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/bin.xml
  (with props)
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/file.txt
  (with props)
    maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/verify.bsh
Modified:
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java

Added: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/filter.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/filter.properties?view=auto&rev=555968
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/filter.properties
(added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/filter.properties
Fri Jul 13 05:24:10 2007
@@ -0,0 +1 @@
+test.properties=foo

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/filter.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/filter.properties
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/goals.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/goals.txt?view=auto&rev=555968
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/goals.txt
(added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/goals.txt
Fri Jul 13 05:24:10 2007
@@ -0,0 +1 @@
+org.apache.maven.plugins:maven-assembly-plugin:testing:assembly

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/goals.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/goals.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/pom.xml?view=auto&rev=555968
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/pom.xml
(added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/pom.xml
Fri Jul 13 05:24:10 2007
@@ -0,0 +1,32 @@
+<?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>org.test</groupId>
+	<artifactId>parent</artifactId>
+	<version>1.0</version>
+	<name>Parent</name>
+	
+	
+	<!-- Purpose of this integration test: verify that filters can be defined within the
plugin configuration -->
+	<!-- (see MASSEMBLY-226 for further information)-->
+	
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<version>testing</version>
+				<configuration>
+					<descriptors>
+						<descriptor>src/assemble/bin.xml</descriptor>
+					</descriptors>
+					<filters>
+						<filter>filter.properties</filter>
+					</filters>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/bin.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/bin.xml?view=auto&rev=555968
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/bin.xml
(added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/bin.xml
Fri Jul 13 05:24:10 2007
@@ -0,0 +1,14 @@
+<assembly>
+  <id>filtered-assembly</id>
+  <formats>
+    <format>dir</format>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/config/file.txt</source>
+      <filtered>true</filtered>
+    </file>
+  </files>
+</assembly>

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/bin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/assemble/bin.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/file.txt?view=auto&rev=555968
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/file.txt
(added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/file.txt
Fri Jul 13 05:24:10 2007
@@ -0,0 +1 @@
+${test.properties}

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/file.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/src/config/file.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/verify.bsh?view=auto&rev=555968
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/verify.bsh
(added)
+++ maven/plugins/trunk/maven-assembly-plugin/src/it/filtering-feature/filtersDefinedInAssemblyPluginConfig/verify.bsh
Fri Jul 13 05:24:10 2007
@@ -0,0 +1,22 @@
+import java.io.*;
+import java.net.*;
+import java.util.jar.*;
+
+boolean result = true;
+
+try
+{
+    File file = new File( basedir, "target/parent-1.0-filtered-assembly.dir/file.txt");
+    if(result) {
+        BufferedReader r = new BufferedReader(new FileReader(file));
+        String s = r.readLine();
+        result = s.equals("foo");
+    }
+}
+catch( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java?view=diff&rev=555968&r1=555967&r2=555968
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java
Fri Jul 13 05:24:10 2007
@@ -218,8 +218,7 @@
     private MavenArchiveConfiguration archive;
 
     /**
-     * @parameter default-value="${project.build.filters}"
-     * @readonly
+     * @parameter
      */
     protected List filters;
 
@@ -412,6 +411,10 @@
 
     public List getFilters()
     {
+        if ( filters == null )
+        {
+            filters = getProject().getBuild().getFilters();
+        }
         return filters;
     }
 



Mime
View raw message