From 337e3857b1b5c9668d4a3872fdc7960b4cb5e2d4 Mon Sep 17 00:00:00 2001 From: ltheussl Date: Mon, 1 May 2006 18:08:53 +0000 Subject: [PATCH] PR: MPWAR-37 Submitted by: Troy Poppe Reviewed by: Stephane Nicoll Added ability to expand properties when copying war resources. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@398659 13f79535-47bb-0310-9956-ffa450edef68 --- war/plugin.jelly | 5 ++ war/plugin.properties | 4 ++ war/src/plugin-test/test03/LICENSE.txt | 1 + war/src/plugin-test/test03/maven.xml | 38 +++++++++++++ war/src/plugin-test/test03/project.properties | 1 + war/src/plugin-test/test03/project.xml | 55 +++++++++++++++++++ .../plugin-test/test03/src/webapp/index.html | 25 +++++++++ war/src/plugin-test/test04/LICENSE.txt | 1 + war/src/plugin-test/test04/maven.xml | 39 +++++++++++++ war/src/plugin-test/test04/project.properties | 8 +++ war/src/plugin-test/test04/project.xml | 55 +++++++++++++++++++ .../plugin-test/test04/src/webapp/index.html | 25 +++++++++ war/xdocs/changes.xml | 1 + war/xdocs/properties.xml | 8 +++ 14 files changed, 266 insertions(+) create mode 100644 war/src/plugin-test/test03/LICENSE.txt create mode 100644 war/src/plugin-test/test03/maven.xml create mode 100644 war/src/plugin-test/test03/project.properties create mode 100644 war/src/plugin-test/test03/project.xml create mode 100644 war/src/plugin-test/test03/src/webapp/index.html create mode 100644 war/src/plugin-test/test04/LICENSE.txt create mode 100644 war/src/plugin-test/test04/maven.xml create mode 100644 war/src/plugin-test/test04/project.properties create mode 100644 war/src/plugin-test/test04/project.xml create mode 100644 war/src/plugin-test/test04/src/webapp/index.html diff --git a/war/plugin.jelly b/war/plugin.jelly index a35cb830..4f8328ae 100644 --- a/war/plugin.jelly +++ b/war/plugin.jelly @@ -117,6 +117,11 @@ includes="${maven.war.src.includes}" excludes="${maven.war.src.excludes}"> + + + + + diff --git a/war/plugin.properties b/war/plugin.properties index de8add86..a244374f 100644 --- a/war/plugin.properties +++ b/war/plugin.properties @@ -31,6 +31,10 @@ maven.war.src=${maven.src.dir}/webapp maven.war.src.includes=** maven.war.src.excludes= +# Whether to perform property expansion for +# copied resources. +maven.war.property.expansion=false + # Location of web.xml file maven.war.webxml=${maven.war.src}/WEB-INF/web.xml diff --git a/war/src/plugin-test/test03/LICENSE.txt b/war/src/plugin-test/test03/LICENSE.txt new file mode 100644 index 00000000..6192027b --- /dev/null +++ b/war/src/plugin-test/test03/LICENSE.txt @@ -0,0 +1 @@ +Sample license \ No newline at end of file diff --git a/war/src/plugin-test/test03/maven.xml b/war/src/plugin-test/test03/maven.xml new file mode 100644 index 00000000..24b63560 --- /dev/null +++ b/war/src/plugin-test/test03/maven.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/war/src/plugin-test/test03/project.properties b/war/src/plugin-test/test03/project.properties new file mode 100644 index 00000000..f2c22f2b --- /dev/null +++ b/war/src/plugin-test/test03/project.properties @@ -0,0 +1 @@ +maven.war.property.expansion=true diff --git a/war/src/plugin-test/test03/project.xml b/war/src/plugin-test/test03/project.xml new file mode 100644 index 00000000..321787a7 --- /dev/null +++ b/war/src/plugin-test/test03/project.xml @@ -0,0 +1,55 @@ + + + + + + 3 + test-maven-war-plugin-expand-properties-false + Maven War Plugin 03 + 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.property.expansion if false + test for maven.war.property.expansion + 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/test03/src/webapp/index.html b/war/src/plugin-test/test03/src/webapp/index.html new file mode 100644 index 00000000..421072b7 --- /dev/null +++ b/war/src/plugin-test/test03/src/webapp/index.html @@ -0,0 +1,25 @@ + + + +

Simple WebApp Home

+

+ This is a html page for ${pom.artifactId} +

+ + \ No newline at end of file diff --git a/war/src/plugin-test/test04/LICENSE.txt b/war/src/plugin-test/test04/LICENSE.txt new file mode 100644 index 00000000..6192027b --- /dev/null +++ b/war/src/plugin-test/test04/LICENSE.txt @@ -0,0 +1 @@ +Sample license \ No newline at end of file diff --git a/war/src/plugin-test/test04/maven.xml b/war/src/plugin-test/test04/maven.xml new file mode 100644 index 00000000..ed777934 --- /dev/null +++ b/war/src/plugin-test/test04/maven.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/war/src/plugin-test/test04/project.properties b/war/src/plugin-test/test04/project.properties new file mode 100644 index 00000000..9bf0a69b --- /dev/null +++ b/war/src/plugin-test/test04/project.properties @@ -0,0 +1,8 @@ + +# +# Expand properties +maven.war.property.expansion=true + +# +# Property being replaced +my.cool.property=${pom.artifactId} diff --git a/war/src/plugin-test/test04/project.xml b/war/src/plugin-test/test04/project.xml new file mode 100644 index 00000000..02c19b06 --- /dev/null +++ b/war/src/plugin-test/test04/project.xml @@ -0,0 +1,55 @@ + + + + + + 3 + test-maven-war-plugin-expand-properties-true + Maven War Plugin 04 + 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.property.expansion if true + test for maven.war.property.expansion + 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/test04/src/webapp/index.html b/war/src/plugin-test/test04/src/webapp/index.html new file mode 100644 index 00000000..63e8ace9 --- /dev/null +++ b/war/src/plugin-test/test04/src/webapp/index.html @@ -0,0 +1,25 @@ + + + +

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 af9f22eb..8e54c0e9 100644 --- a/war/xdocs/changes.xml +++ b/war/xdocs/changes.xml @@ -25,6 +25,7 @@ + Added ability to expand properties when copying war resources. Updated wrong documentation regarding web.xml filtering. Now filtering when copying resources. Added property maven.war.webxml.overwrite to control if the source web.xml overwrite the one in the generated webapp directory. diff --git a/war/xdocs/properties.xml b/war/xdocs/properties.xml index b81523e5..40528083 100644 --- a/war/xdocs/properties.xml +++ b/war/xdocs/properties.xml @@ -59,6 +59,14 @@ by default. + + maven.war.property.expansion + Yes + + Whether to perform property expansion for copied + resources. Default to false. + + maven.war.webxml Yes