Maven WAR Plugin
  1. Maven WAR Plugin
  2. MWAR-248

Plugin warns about missing webxml attribute even if one exists

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Description

      I am attaching a debug log that clearly demonstrates how the WAR plugin warns about a missing webxml attribute which exists. I am attempting to let the plugin know that the web.xml file it is encountering is the same one specified by the webxml attribute.

      My pom file contains:

      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <version>2.1.1</version>
      <configuration>
      <failOnMissingWebXml>true</failOnMissingWebXml>
      <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
      </configuration>
      </plugin>

        Issue Links

          Activity

          Hide
          Alex Pogrebnyak added a comment - - edited

          Adding web.xml to webSourceExcludes and specifying webXml explicitly still results in the same warning

          pom.xml
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
              <warSourceExcludes>**/WEB-INF/web.xml</warSourceExcludes>
              <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
            </configuration>
          </plugin>
          
          Show
          Alex Pogrebnyak added a comment - - edited Adding web.xml to webSourceExcludes and specifying webXml explicitly still results in the same warning pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <warSourceExcludes>**/WEB-INF/web.xml</warSourceExcludes> <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml> </configuration> </plugin>
          Hide
          Dennis Lundberg added a comment -

          Fixed by upgrading plexus-archiver to version 2.0.2.

          Show
          Dennis Lundberg added a comment - Fixed by upgrading plexus-archiver to version 2.0.2.
          Hide
          Kristian Rosenvold added a comment -

          We'll have to go to plexus-archiver 2.1 for this one before releasing. 2.0.2 contains a file-mode bug that hits linux systems when unzipping archives with unspecified file permissions. I can push war-release together with archiver "tomorrow".

          Show
          Kristian Rosenvold added a comment - We'll have to go to plexus-archiver 2.1 for this one before releasing. 2.0.2 contains a file-mode bug that hits linux systems when unzipping archives with unspecified file permissions. I can push war-release together with archiver "tomorrow".
          Hide
          Valentin Jacquemin added a comment - - edited

          Starting with an empty war project containing only the web.xml file I still get the warning.

           
          > mvn --version
          Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
          Maven home: C:\utils\apache-maven\bin\..
          Java version: 1.6.0_20, vendor: Sun Microsystems Inc.
          Java home: C:\Program Files (x86)\Java\jdk1.6.0_20\jre
          Default locale: en_US, platform encoding: Cp1252
          OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
          
           
          > more pom.xml
          <?xml version="1.0" encoding="UTF-8" ?>
          <project xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                                http://maven.apache.org/xsd/maven-4.0.0.xsd">
            <modelVersion>4.0.0</modelVersion>
            <groupId>test</groupId>
            <artifactId>maven-war-warning</artifactId>
            <packaging>war</packaging>
            <version>1.0</version>
          </project>
          
           
          > mvn package
          ...
          [WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ig
          nored
          (webxml attribute is missing from war task, or ignoreWebxml attribute is specifi
          ed as 'true')
          

          To get rid of the warning I had to modify the pom to include this unintuitive addition:

           
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
              <packagingExcludes>WEB-INF/web.xml</packagingExcludes>
            </configuration>
          </plugin>
          
          Show
          Valentin Jacquemin added a comment - - edited Starting with an empty war project containing only the web.xml file I still get the warning. > mvn --version Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) Maven home: C:\utils\apache-maven\bin\.. Java version: 1.6.0_20, vendor: Sun Microsystems Inc. Java home: C:\Program Files (x86)\Java\jdk1.6.0_20\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7" , version: "6.1" , arch: "x86" , family: "windows" > more pom.xml <?xml version= "1.0" encoding= "UTF-8" ?> <project xmlns= "http: //maven.apache.org/POM/4.0.0" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http: //maven.apache.org/POM/4.0.0 http: //maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>test</groupId> <artifactId>maven-war-warning</artifactId> <packaging>war</packaging> <version>1.0</version> </project> > mvn package ... [WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ig nored (webxml attribute is missing from war task, or ignoreWebxml attribute is specifi ed as ' true ') To get rid of the warning I had to modify the pom to include this unintuitive addition: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <packagingExcludes>WEB-INF/web.xml</packagingExcludes> </configuration> </plugin>
          Hide
          Anders Hammar added a comment -

          @Valentin: You most likely need to specify the version of the war plugin. I don't think Maven 3.0.4 uses v2.2 by default. Please continue this usage thread on the Maven users list.

          Show
          Anders Hammar added a comment - @Valentin: You most likely need to specify the version of the war plugin. I don't think Maven 3.0.4 uses v2.2 by default. Please continue this usage thread on the Maven users list.

            People

            • Assignee:
              Dennis Lundberg
              Reporter:
              Gili
            • Votes:
              25 Vote for this issue
              Watchers:
              27 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: