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

NullPointerException if no directory specified in webResources tag

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 2.2
    • None
    • None
    • None
    • XP SP3, Eclipse Juno 4.2, Maven 3.0.4

    Description

      I would to exclude directories from the default web resources folder (src/main/webapp) and the documentation (http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html) indicates that it can be done :

      Here's another example of how to specify include and exclude patterns:

      ...
      <configuration>
      <webResources>
      <resource>
      <!-- the default value is ** -->
      <includes>
      <include>**/pattern1</include>
      <include>*pattern2</include>
      </includes>
      <!-- there's no default value for this -->
      <excludes>
      <exclude>*pattern3/pattern3</exclude>
      <exclude>pattern4/pattern4</exclude>
      </excludes>
      </resource>
      </webResources>
      </configuration>
      ...
      But in this case, the plugin throws a NullPointerException : org.apache.maven.plugin.war.packaging.WarProjectPackagingTask (handleWebResources line 125).

      Indeed, the null reference of resource.getDirectory() given to File constructor leads to a null pointer...

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              guillaume44 guillaume
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: