diff --git a/war/plugin.jelly b/war/plugin.jelly index 464c838d..1cad8b92 100644 --- a/war/plugin.jelly +++ b/war/plugin.jelly @@ -28,22 +28,22 @@ - + - + - + - + - + @@ -51,7 +51,7 @@ You must define currentVersion in your POM. - + Building WAR ${pom.artifactId} @@ -60,7 +60,7 @@ - + @@ -71,9 +71,9 @@ - @@ -141,8 +141,8 @@ - - + @@ -151,12 +151,13 @@ - - + + + + @@ -164,21 +165,35 @@ + + + + + + + - + + + + + + - - + @@ -195,35 +210,35 @@ - + - + - - - + + + - - - - + + + + - - DEPRECATION WARNING: + + DEPRECATION WARNING: Use : war.bundle instead of war.bundle.jar - + - + - + @@ -239,78 +254,78 @@ - + - + - + project="${pom}"/> + - + - + - + - + project="${pom}"/> + - - + - - - + project="${pom}"/> + + + - - + + description="Deploys the snapshot version of the war to remote repository"> - + project="${pom}"/> + - - + + - + + description="Remove all artifacts created by war plugin"> - + - + - + @@ -318,13 +333,13 @@ - + - + DEPRECATED: war:load is deprecated, please use maven:get tags diff --git a/war/plugin.properties b/war/plugin.properties index 4decc600..cdb6691f 100644 --- a/war/plugin.properties +++ b/war/plugin.properties @@ -32,6 +32,16 @@ maven.war.src=${maven.src.dir}/webapp maven.war.src.includes=** maven.war.src.excludes= +# The files to excludes when filtering is used +# Note: Files are relative to maven.war.src and are copied afterwards +# without filtering (use this option for binary files namely that will +# get corrupted if expansion is applied on them). +maven.war.expansion.excludes= + +# Indicates whether token filtering should take +# place during the copy. Default is true. +maven.war.src.filtering=on + # Whether to perform property expansion for # copied resources. maven.war.property.expansion=false diff --git a/war/src/plugin-test/test05/LICENSE.txt b/war/src/plugin-test/test05/LICENSE.txt new file mode 100644 index 00000000..6192027b --- /dev/null +++ b/war/src/plugin-test/test05/LICENSE.txt @@ -0,0 +1 @@ +Sample license \ No newline at end of file diff --git a/war/src/plugin-test/test05/maven.xml b/war/src/plugin-test/test05/maven.xml new file mode 100644 index 00000000..60890968 --- /dev/null +++ b/war/src/plugin-test/test05/maven.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/war/src/plugin-test/test05/project.properties b/war/src/plugin-test/test05/project.properties new file mode 100644 index 00000000..4e247735 --- /dev/null +++ b/war/src/plugin-test/test05/project.properties @@ -0,0 +1,10 @@ + +# +# Expand properties +maven.war.property.expansion=true + +maven.war.expansion.excludes=images/** + +# +# Property being replaced +my.cool.property=${pom.artifactId} diff --git a/war/src/plugin-test/test05/project.xml b/war/src/plugin-test/test05/project.xml new file mode 100644 index 00000000..8170aaa4 --- /dev/null +++ b/war/src/plugin-test/test05/project.xml @@ -0,0 +1,56 @@ + + + + + + 3 + test-maven-war-plugin-expand-excludes + Maven War Plugin 05 + maven + 1.0 + + Apache Software Foundation + http://www.apache.org/ + http://maven.apache.org/images/apache-maven-project.png + + 2001 + org.apache.maven + http://maven.apache.org/images/maven.gif + Test for Maven War plugin, tests maven.war.expansion.excludes + test for maven.war.expansion.excludes + http://maven.apache.org/maven-1.x/plugins/war/ + /www/maven.apache.org/maven-1.x/plugins/war/ + + scm:svn:http://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/war/ + http://svn.apache.org/viewcvs.cgi/maven/maven-1/plugins/trunk/war/ + + + + commons-logging + commons-logging + 1.0.4 + http://jakarta.apache.org/commons/logging.html + + true + true + + + + diff --git a/war/src/plugin-test/test05/src/webapp/images/logo.png b/war/src/plugin-test/test05/src/webapp/images/logo.png new file mode 100644 index 00000000..81f80d81 Binary files /dev/null and b/war/src/plugin-test/test05/src/webapp/images/logo.png differ diff --git a/war/src/plugin-test/test05/src/webapp/index.html b/war/src/plugin-test/test05/src/webapp/index.html new file mode 100644 index 00000000..a57c1fc5 --- /dev/null +++ b/war/src/plugin-test/test05/src/webapp/index.html @@ -0,0 +1,26 @@ + + + +

Simple WebApp Home

+

+ This is a html page for ${my.cool.property} +

+ + \ No newline at end of file diff --git a/war/xdocs/changes.xml b/war/xdocs/changes.xml index b76c53a7..9528cd6e 100644 --- a/war/xdocs/changes.xml +++ b/war/xdocs/changes.xml @@ -25,6 +25,11 @@ + Added maven.war.expansion.excludes property + to exclude files during a property expansion copy (Fixes corruption of binary files). + Applied property expansion to web.xml handling for consistency. Introduced the maven.war.src.filtering + property to control whether filtering is enabled or not when copying webapp resources. + Only create tld and lib folders if corresponding dependencies are present. war:inplace should check for maven.war.src. diff --git a/war/xdocs/properties.xml b/war/xdocs/properties.xml index 4eb20ba8..e7300b06 100644 --- a/war/xdocs/properties.xml +++ b/war/xdocs/properties.xml @@ -44,20 +44,40 @@ maven.war.src.includes Yes - Comma or space separated list of Ant path patterns specifycing + Comma or space separated list of Ant path patterns specifying what files and directories from ${maven.war.src} - should be included in the web application. All files are included - by default. + that should be included in the web application. All files are + included by default. maven.war.src.excludes Yes - Comma or space separated list of Ant path patterns specifycing + Comma or space separated list of Ant path patterns specifying what files and directories from ${maven.war.src} - should be excluded from the web application. No files are excluded - by default. + that should be excluded from the web application. No files are + excluded by default. + + + + maven.war.expansion.excludes + Yes + + Comma or space separated list of Ant path patterns specifying + the files and directories from ${maven.war.src} that + should be excluded from the copy when performing property expansion. + If property expansion is not enabled this property is ignored. Files + in this excludes list are copied to the webapp without property + expansion afterwards. No files are excluded by default. + + + + maven.war.src.filtering + Yes + + Indicates whether token filtering should take place during the copy. + Default is true.