Uploaded image for project: 'Maven WAR Plugin'
  1. Maven WAR Plugin
  2. MWAR-52

WAR plugin does not honor the webXml configuration setting [patch included!]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0.1
    • 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 );

      Attachments

        1. my-webapp.zip
          2 kB
          Brett Porter
        2. patch.txt
          1 kB
          Andreas Schildbach

        Activity

          People

            brett Brett Porter
            goonie Andreas Schildbach
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.25h Original Estimate - 0.25h
                0.25h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h