Issue Details (XML | Word | Printable)

Key: MWAR-8
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Emmanuel Venisse
Reporter: David Hawkins
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven 2.x WAR Plugin

Merge contents of dependent wars into war being built

Created: 10/Nov/05 03:28 PM   Updated: 08/Mar/06 11:10 PM   Resolved: 23/Dec/05 10:12 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Time Tracking:
Not Specified

File Attachments: 1. Text File MNG-1507-maven-war-plugin.patch (9 kB)



 Description  « Hide

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.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0-beta-3-SNAPSHOT</version>
<configuration>
<!-- This is the default for dependentWarIncludes
<dependentWarIncludes>**</dependentWarIncludes>
-->
<dependentWarExcludes>*/.properties</dependentWarExcludes>
</configuration>
</plugin>

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.

<configuration>
<excludes>WEB-INF/lib/overwriteme.jar</excludes>
</configuration>



David Hawkins made changes - 10/Nov/05 03:30 PM
Field Original Value New Value
Attachment MNG-1507-maven-war-plugin.patch [ 17509 ]
Emmanuel Venisse added a comment - 24/Nov/05 08:31 AM

Applied


Emmanuel Venisse made changes - 24/Nov/05 08:31 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Assignee Emmanuel Venisse [ evenisse ]
Fix Version/s 2.0.1 [ 12000 ]
Maria Odea Ching made changes - 20/Dec/05 12:00 AM
Workflow Maven [ 41833 ] jira [ 44176 ]
Fix Version/s 2.0.1 [ 12000 ]
Project Maven 2 [ 10500 ] Maven 2.x War Plugin [ 11150 ]
Key MNG-1507 MWAR-8
Component/s maven-war-plugin [ 11796 ]
Affects Version/s 2.0 [ 11703 ]
Stephane Nicoll made changes - 23/Dec/05 10:12 AM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Stephane Nicoll made changes - 23/Dec/05 10:12 AM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Closed [ 6 ]
Fix Version/s 2.0 [ 12160 ]
Jason van Zyl made changes - 27/Dec/05 08:31 PM
Workflow jira [ 44176 ] Maven [ 45123 ]
Brett Porter made changes - 08/Mar/06 11:10 PM
Workflow Maven [ 45123 ] Maven New [ 52459 ]