Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Auto Closed
-
2.4.3, 2.5
-
None
-
None
-
Maven 3.0.2
CentOS 5.5
Description
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><<*>></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.