Maven 2 & 3

[regression] Properties defined in profiles.xml of parent are not inherited during multimodule build

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.1.0
  • Fix Version/s: 2.2.0
  • Labels:
    None
  • Environment:
    OS: Windows XP Professional.
    Java: 1.4.2_06
    Maven: 2.1.0
  • Complexity:
    Intermediate
  • Testcase included:
    yes
  • Number of attachments :
    2

Description

Next multimodule project structure is given:

/
--/parent/
------------pom.xml - this is aggregator which holds reference to child module in <modules> section.
------------profiles.xml - contains custom property "test.property=test-property-value".
--/child/
------------/src/main/resources/child.properties - contains property "some.useful.property=@test.property@". This property should be filtered using value defined - in profiles.xml.
------------/pom.xml - contains reference to parent/pom.xml in <parent> pom section.

So, when I run "mvn clean install" using parent/pom.xml I expect that in child/target/child.properties I will see filtered property "some.useful.property=test-property-value". But property remains unfiltered. src/main/resources in child/pom.xml are marjed as filtered.

Also, when I run the same command from "child" folder then property is filtered with right value. In single module build all works.

Maven 2.0.10 behaves in expected way and filters this property in both cases.

See attached test case.

Activity

Hide
denis dudinski added a comment -

Patch that fixes mentioned problem.

Show
denis dudinski added a comment - Patch that fixes mentioned problem.
Hide
Benjamin Bentmann added a comment -

This defect applies to POM interpolation as well

Show
Benjamin Bentmann added a comment - This defect applies to POM interpolation as well
Hide
Benjamin Bentmann added a comment -

Fixed in r763796, thanks for the patch!

Show
Benjamin Bentmann added a comment - Fixed in r763796, thanks for the patch!
Hide
Will Horn added a comment -

Is this fix supposed to be in 2.2.0 RC2? I find my profiles.xml properties are not read by maven.

Show
Will Horn added a comment - Is this fix supposed to be in 2.2.0 RC2? I find my profiles.xml properties are not read by maven.
Hide
Will Horn added a comment -

False alarm, the profile in my profiles.xml was not active.

In 2.0.9 my profile was active by default, now I have to explicitly add it to activeProfiles.

Show
Will Horn added a comment - False alarm, the profile in my profiles.xml was not active. In 2.0.9 my profile was active by default, now I have to explicitly add it to activeProfiles.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: