Issue Details (XML | Word | Printable)

Key: MPEAR-24
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Felipe Leme
Reporter: Felipe Leme
Votes: 0
Watchers: 0
Operations

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

Duplicated entries if maven.ear.src and maven.ear.resources are the same

Created: 14/Oct/04 09:33 AM   Updated: 16/Nov/04 12:28 AM   Resolved: 16/Nov/04 12:28 AM
Return to search
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.6

Time Tracking:
Original Estimate: 1 hour
Original Estimate - 1 hour
Remaining Estimate: 1 hour
Remaining Estimate - 1 hour
Time Spent: Not Specified
Time Spent - Not Specified


 Description  « Hide

The value of these 2 variables are different by default, but if the user change them so they become equals, the entries on that directory will be added twice in the generated ear.

That happens because we have 2 fileset entries in the Jelly script:

<fileset dir="${maven.ear.resources}" />
<fileset dir="${maven.ear.src}" casesensitive="false"
excludes="**/META-INF/application.xml"/>

The solution is simple, it's just a matter of adding an <j:if> as shown below:

<j:if test="${!pom.build.resources.isEmpty()}">
<mkdir dir="${maven.ear.resources}"/>
<maven:copy-resources resources="${pom.build.resources}" todir="${maven.ear.resources}"/>
<!-- if added below -->
<j:if test="${context.getVariable('maven.ear.resources') != context.getVariable('maven.ear.src')}">
<fileset dir="${maven.ear.resources}" />
</j:if>
</j:if>

(and also, that block should come before the other <fileset> block)

I will fix it later (the most difficult part will be writing a test case

– Felipe



Felipe Leme added a comment - 16/Nov/04 12:28 AM

I opted for a simpler solution: forbid a project of setting both properties with the same value!


Felipe Leme made changes - 16/Nov/04 12:28 AM
Field Original Value New Value
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]