maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Walsh (JIRA)" <j...@codehaus.org>
Subject [jira] Created: (MRESOURCES-146) Maven resources plugin doesn't filter all files all the time
Date Fri, 27 May 2011 20:53:22 GMT
Maven resources plugin doesn't filter all files all the time 
-------------------------------------------------------------

                 Key: MRESOURCES-146
                 URL: http://jira.codehaus.org/browse/MRESOURCES-146
             Project: Maven 2.x Resources Plugin
          Issue Type: Bug
          Components: delimiters, filtering
    Affects Versions: 2.5, 2.4.3
         Environment: Maven 3.0.2
CentOS 5.5 
            Reporter: Matt Walsh
         Attachments: mvn-resources-test.zip

I have several files in src/main/webResources, but using maven-resources-plugin to do the
filtering as maven-war-plugin doesn't support alternate delimiters (yet?).

Using the following alternate delimiters for filtering: <<*>>
Configured as follows:

<build>
  <filters>
    <filter>src/main/filters/common.properties</filter>
  </filters>
  <plugins>
    <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>${resources.version}</version>
      <executions>
         <execution>
         <id>copy-webresources</id>
           <phase>generate-resources</phase>
           <goals>
             <goal>copy-resources</goal>
           </goals>
           <configuration>
             <delimiters>
               <delimiter>&lt;&lt;*&gt;&gt;</delimiter>
             </delimiters>
             <useDefaultDelimiters>${default.delim}</useDefaultDelimiters>
             <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
             <overwrite>true</overwrite>
             <resources>
               <resource>
                 <directory>src/main/webResources</directory>
                 <filtering>true</filtering>
               </resource>
             </resources>
           </configuration>
         </execution>
       </executions>
    </plugin>
  </plugins>
</build>

With version 2.4.3:
 - set useDefaultDelimiters to true (the default) and only some files get filtered (same ones
all the time). Filters both alternate and default delimiters when filters at all.
 - set useDefaultDelimiters to false and all files get filtered (alternate delimiters only).

With version 2.5:
 - doesn't filter alternate delimiters at all. Filters defaults when set to true.


Output from test runs with attached project:
EXAMPLE1: 2.4.3 with default delimiters enabled:

$ mvn clean package -Dresources.version=2.4.3 -Ddefault.delim=true                       
                                    [INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mvn-resources-test Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ mvn-resources-test ---
[INFO] Deleting /build/merges/matt/maven-resources-test/mvn-resources-test/target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:copy-resources (copy-webresources) @ mvn-resources-test
---
[WARNING] File encoding has not been set, using platform encoding ISO-8859-1, i.e. build is
platform dependent!
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ mvn-resources-test
---
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mvn-resources-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ mvn-resources-test
---
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] skip non existing resourceDirectory /build/merges/matt/maven-resources-test/mvn-resources-test/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ mvn-resources-test
---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ mvn-resources-test ---
[INFO] No tests to run.
[INFO] Surefire report directory: /build/merges/matt/maven-resources-test/mvn-resources-test/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ mvn-resources-test ---
[INFO] Packaging webapp
[INFO] Assembling webapp [mvn-resources-test] in [/build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test]
[INFO] Processing war project
[INFO] Copying webapp resources [/build/merges/matt/maven-resources-test/mvn-resources-test/src/main/webapp]
[INFO] Webapp assembled in [30 msecs]
[INFO] Building war: /build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.497s
[INFO] Finished at: Fri May 27 14:34:19 MDT 2011
[INFO] Final Memory: 11M/981M
[INFO] ------------------------------------------------------------------------

$ grep -H lsdId ./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/includes/jsp/header.jsp \
./target/mvn-resources-test/default/game/includes/jsp/header.jsp \
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp \
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/members/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties

./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "${lsdId}";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "${lsdId}";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "zero";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "zero";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp:        String lsdId
= "<<lsdId>>";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp: String lsdId = "${lsdId}";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "<<lsdId>>";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "${lsdId}";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "${lsdId}";
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=zero
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=zero

EXAMPLE2: 2.4.3 with default delimiters disabled:

$ mvn clean package -Dresources.version=2.4.3 -Ddefault.delim=false
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mvn-resources-test Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ mvn-resources-test ---
[INFO] Deleting /build/merges/matt/maven-resources-test/mvn-resources-test/target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:copy-resources (copy-webresources) @ mvn-resources-test
---
[WARNING] File encoding has not been set, using platform encoding ISO-8859-1, i.e. build is
platform dependent!
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ mvn-resources-test
---
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mvn-resources-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ mvn-resources-test
---
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] skip non existing resourceDirectory /build/merges/matt/maven-resources-test/mvn-resources-test/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ mvn-resources-test
---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ mvn-resources-test ---
[INFO] No tests to run.
[INFO] Surefire report directory: /build/merges/matt/maven-resources-test/mvn-resources-test/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ mvn-resources-test ---
[INFO] Packaging webapp
[INFO] Assembling webapp [mvn-resources-test] in [/build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test]
[INFO] Processing war project
[INFO] Copying webapp resources [/build/merges/matt/maven-resources-test/mvn-resources-test/src/main/webapp]
[INFO] Webapp assembled in [31 msecs]
[INFO] Building war: /build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.495s
[INFO] Finished at: Fri May 27 14:39:09 MDT 2011
[INFO] Final Memory: 10M/981M
[INFO] ------------------------------------------------------------------------

$ grep -H lsdId ./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/includes/jsp/header.jsp \
./target/mvn-resources-test/default/game/includes/jsp/header.jsp \
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp \
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/members/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties

./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "zero";
./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "${lsdId}";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "zero";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "${lsdId}";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "zero";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "${lsdId}";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp:        String lsdId
= "zero";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp: String lsdId = "${lsdId}";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "zero";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "${lsdId}";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "zero";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "${lsdId}";
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=zero
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=${lsdId}

EXAMPLE3: 2.5 with default delimiters enabled:

$ mvn clean package -Dresources.version=2.5 -Ddefault.delim=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mvn-resources-test Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ mvn-resources-test ---
[INFO] Deleting /build/merges/matt/maven-resources-test/mvn-resources-test/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:copy-resources (copy-webresources) @ mvn-resources-test
---
[debug] execute contextualize
[WARNING] File encoding has not been set, using platform encoding ISO-8859-1, i.e. build is
platform dependent!
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ mvn-resources-test ---
[debug] execute contextualize
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mvn-resources-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ mvn-resources-test
---
[debug] execute contextualize
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] skip non existing resourceDirectory /build/merges/matt/maven-resources-test/mvn-resources-test/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ mvn-resources-test
---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ mvn-resources-test ---
[INFO] No tests to run.
[INFO] Surefire report directory: /build/merges/matt/maven-resources-test/mvn-resources-test/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ mvn-resources-test ---
[INFO] Packaging webapp
[INFO] Assembling webapp [mvn-resources-test] in [/build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test]
[INFO] Processing war project
[INFO] Copying webapp resources [/build/merges/matt/maven-resources-test/mvn-resources-test/src/main/webapp]
[INFO] Webapp assembled in [30 msecs]
[INFO] Building war: /build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.510s
[INFO] Finished at: Fri May 27 14:40:31 MDT 2011
[INFO] Final Memory: 11M/981M
[INFO] ------------------------------------------------------------------------

$ grep -H lsdId ./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/includes/jsp/header.jsp \
./target/mvn-resources-test/default/game/includes/jsp/header.jsp \
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp \
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/members/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties

./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "zero";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "zero";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "zero";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp:        String lsdId
= "<<lsdId>>";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp: String lsdId = "zero";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "<<lsdId>>";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "zero";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "zero";
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=<<lsdId>>
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=zero

EXAMPLE4: 2.5 with default delimiters disabled:

$ mvn clean package -Dresources.version=2.5 -Ddefault.delim=false                        
                                    [INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mvn-resources-test Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ mvn-resources-test ---
[INFO] Deleting /build/merges/matt/maven-resources-test/mvn-resources-test/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:copy-resources (copy-webresources) @ mvn-resources-test
---
[debug] execute contextualize
[WARNING] File encoding has not been set, using platform encoding ISO-8859-1, i.e. build is
platform dependent!
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ mvn-resources-test ---
[debug] execute contextualize
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mvn-resources-test ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ mvn-resources-test
---
[debug] execute contextualize
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build
is platform dependent!
[INFO] skip non existing resourceDirectory /build/merges/matt/maven-resources-test/mvn-resources-test/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ mvn-resources-test
---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ mvn-resources-test ---
[INFO] No tests to run.
[INFO] Surefire report directory: /build/merges/matt/maven-resources-test/mvn-resources-test/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ mvn-resources-test ---
[INFO] Packaging webapp
[INFO] Assembling webapp [mvn-resources-test] in [/build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test]
[INFO] Processing war project
[INFO] Copying webapp resources [/build/merges/matt/maven-resources-test/mvn-resources-test/src/main/webapp]
[INFO] Webapp assembled in [29 msecs]
[INFO] Building war: /build/merges/matt/maven-resources-test/mvn-resources-test/target/mvn-resources-test.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.508s
[INFO] Finished at: Fri May 27 14:41:40 MDT 2011
[INFO] Final Memory: 11M/981M
[INFO] ------------------------------------------------------------------------

$ grep -H lsdId ./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/includes/jsp/header.jsp \
./target/mvn-resources-test/default/game/includes/jsp/header.jsp \
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp \
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp \
./target/mvn-resources-test/default/members/includes/jsp/header.jsp \
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties

./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/lobby/includes/jsp/header.jsp:      String lsdId = "${lsdId}";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/client/includes/jsp/header.jsp:     String lsdId = "${lsdId}";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/game/includes/jsp/header.jsp:  String lsdId = "${lsdId}";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp:        String lsdId
= "<<lsdId>>";
./target/mvn-resources-test/default/webmasters/includes/jsp/header.jsp: String lsdId = "${lsdId}";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "<<lsdId>>";
./target/mvn-resources-test/default/multiplayerlobby/includes/jsp/header.jsp:   String lsdId
= "${lsdId}";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "<<lsdId>>";
./target/mvn-resources-test/default/members/includes/jsp/header.jsp:    String lsdId = "${lsdId}";
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=<<lsdId>>
./target/mvn-resources-test/default/client/WEB-INF/classes/global.properties:lsdId=${lsdId}


My test project is attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message