Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0
-
None
-
None
Description
The WAR plugin does not honor the webXml configuration setting. I think this comes from web.xml being hardcoded into WarMojo, rather than using the default-value mechanism for the MOJO attribute.
Here is a patch:
Index: C:/cc/sd_area51_3/OcToPuS/tools/maven/plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
===================================================================
— C:/cc/sd_area51_3/OcToPuS/tools/maven/plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (revision 416739)
+++ C:/cc/sd_area51_3/OcToPuS/tools/maven/plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (working copy)
@@ -102,7 +102,7 @@
/**
- The path to the web.xml file to use.
*
- * @parameter expression="${maven.war.webxml}"
+ * @parameter expression="${maven.war.webxml}" default-value="WEB-INF/web.xml"
*/
private File webXml;
Index: C:/cc/sd_area51_3/OcToPuS/tools/maven/plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java
===================================================================
— C:/cc/sd_area51_3/OcToPuS/tools/maven/plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java (revision 416739)
+++ C:/cc/sd_area51_3/OcToPuS/tools/maven/plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java (working copy)
@@ -177,7 +177,7 @@
warArchiver.addDirectory( getWebappDirectory() );
- warArchiver.setWebxml( new File( getWebappDirectory(), "WEB-INF/web.xml" ) );
+ warArchiver.setWebxml( getWebXml() );
// create archive
archiver.createArchive( getProject(), archive );