Maven 2.x WAR Plugin

Filtering issue: wrong replacement of properties by values from MavenProject object

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.2
  • Fix Version/s: 2.1-beta-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    1

Description

When the filter option is enabled in the war plugin, the plugin searches in the affected files for the pattern @...@ and ${...}. If such a pattern is found, the plugin tries to replace the found value. Therefore the ReflectionValueExtractor is used which removes the first part before the dot of the given value; e.g. "node.version" becomes "version". Then the ReflectionValueExtractor tries to find a get- or is-method in the given object (a MavenProject object).
That means: if the 2nd part of the ${}-property can be found as getter in the MavenProject class, the plugin always uses the maven plugin values.

The value extractor should only remove the 1st part from the property if the property begins with "project.".

There is a similar bug report for the resource plugin (date june 2006!!!) which is not yet assigned (title: Filtering ${foo.file} evaluates to in full path to pom.xml).

Issue Links

Activity

Hide
Brett Okken added a comment -
Show
Brett Okken added a comment - The resource bug is http://jira.codehaus.org/browse/MRESOURCES-20
Hide
Matthew Beermann added a comment -

This should be a simple fix...

Show
Matthew Beermann added a comment - This should be a simple fix...
Hide
Stephane Nicoll added a comment -

Maven filtering component is handling this scenario properly. Added an it to validate it.

Note that it will work with webResources only. Standard maven resources are still handled by the resources plugin, refer to the linked issue for more information.

Show
Stephane Nicoll added a comment - Maven filtering component is handling this scenario properly. Added an it to validate it. Note that it will work with webResources only. Standard maven resources are still handled by the resources plugin, refer to the linked issue for more information.
Hide
Olivier Lamy added a comment -

see comment in MRESOURCES-20

Show
Olivier Lamy added a comment - see comment in MRESOURCES-20
Hide
Olivier Lamy added a comment -

fix in rev 692743

Show
Olivier Lamy added a comment - fix in rev 692743

People

Vote (11)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: