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

Merge contents of dependent wars into war being built


    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:


      We added functionality to the maven-war-plugin to copy the contents of dependent wars into the war being built. It will never overwrite existing files and has configurable includes and excludes which are applied to the files being copied.

      Also made a minor change in getExcludes to not add the default excludes from FileUtils. The default excludes were already being added in the method getWarFiles( File sourceDir ) by scanner.addDefaultExcludes().

      We are trying to integrate Maven into our environment and not having this functionality was a show-stopper for us. We have applications that reuse jsps, and .tag files from a generic war that need to be included in all of our wars. We have also seen people request this functionality.

      By default these changes will have no effect, unless you have wars specified in your <dependencies>.

      Here is an example configuration that uses the includes and excludes for the dependent wars.

      <!-- This is the default for dependentWarIncludes

      It will not overwrite existing files that are already in the war, the way to get around this is to remove the files you want overwritten using the standard excludes configuration. For example, the following configuration would allow the overwriteme.jar to be overwritten by something in a dependent war.





            • Assignee:
              evenisse Emmanuel Venisse
              dhawkins David Hawkins
            • Votes:
              1 Vote for this issue
              1 Start watching this issue


              • Created: