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

"excludes" on ceased to work on resources from warSourceDirectoryin 2.1.1 (worked in 2.0.1)

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I have a following configuration of the plugin

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>${war.plugin.version}</version>
          <configuration>
              <warSourceDirectory>src/main/webapp</warSourceDirectory>
              <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
              <excludes>
                  **/tech_*.properties, **/*log4j*.properties,
                  **/pom.xml, **/JasperReports/*.*,
                  **/app_ffe_cryptography.keystore
              </excludes>
              <webResources>
                  <resource>
                      <directory>${basedir}/target/xsd-assembly/</directory>
                      <targetPath>/</targetPath>
                      <includes>
                          <include>xsd/**/*.xsd</include>
                          <include>wsdl/**/*.wsdl</include>
                      </includes>
                  </resource>
              </webResources>
          </configuration>
      </plugin>
      

      If war.plugin.version is set to 2.0.1 then resulting war does not contain tech_*.properties files in its WEB-INF/classes directory.
      If war.plugin.version is set to 2.1.1 then files are present.

      As far as I can see this change in the behavior occurred silently - it is not mentioned in anywhere changelogs.
      Is it done intentionally?

        Activity

        Hide
        Oleksandr Alesinskyy added a comment - - edited

        May add that

        1. this change occurred in 2.1-alpha-1 or in 2.1-alpha-2 (2.0.2 still excludes files, 2.1-alpha-2 does not exclude, builds with 2.1-alpha-1 fail in the middle due to ClassNotFoundException).
        2. Behavior is identical in Maven 2.2.1 and Maven 3.0.3
        Show
        Oleksandr Alesinskyy added a comment - - edited May add that this change occurred in 2.1-alpha-1 or in 2.1-alpha-2 (2.0.2 still excludes files, 2.1-alpha-2 does not exclude, builds with 2.1-alpha-1 fail in the middle due to ClassNotFoundException). Behavior is identical in Maven 2.2.1 and Maven 3.0.3
        Hide
        Dennis Lundberg added a comment -

        Where in your source tree is this file located?

        Show
        Dennis Lundberg added a comment - Where in your source tree is this file located?
        Hide
        Oleksandr Alesinskyy added a comment -

        /src/main/resources of the grandparent. BTW, it is not one file, but 15 files.
        So the structure is

        /
        |-pom.xml
        |-/src
        |--/main
        |----/resources
        |-----tech*.properties
        |-/presentation
        |--pom.xml
        |--/fbs-web
        |---pom.xml (war plugin configuration)
        
        Show
        Oleksandr Alesinskyy added a comment - /src/main/resources of the grandparent. BTW, it is not one file, but 15 files. So the structure is / |-pom.xml |-/src |--/main |----/resources |-----tech*.properties |-/presentation |--pom.xml |--/fbs-web |---pom.xml (war plugin configuration)
        Hide
        Oleksandr Alesinskyy added a comment -

        The replacement of <excludes> with <packagingExcludes> brings desired result, so it seems to be mostly a documentation issue (a noticeable behavioral change is not mentioned). That said, the description of the war:war goal (http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html) does not include <excludes> any more.

        Show
        Oleksandr Alesinskyy added a comment - The replacement of <excludes> with <packagingExcludes> brings desired result, so it seems to be mostly a documentation issue (a noticeable behavioral change is not mentioned). That said, the description of the war:war goal ( http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html ) does not include <excludes> any more.
        Hide
        Dennis Lundberg added a comment -

        Yes, the behavior changed in version 2.1. That was intended. The docs are up-to-date now.

        Show
        Dennis Lundberg added a comment - Yes, the behavior changed in version 2.1. That was intended. The docs are up-to-date now.
        Dennis Lundberg made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Not A Bug [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Oleksandr Alesinskyy
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: