Maven 2 & 3

Can't use pom properties inside resource directory tag

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

I have pom.xml with following snippet:

<build>
<sourceDirectory>src\JavaSource</sourceDirectory>
<resources>
<resource>
<directory>src\JavaSource</directory>

and it works.
If I use property like this

<build>
<sourceDirectory>src\JavaSource</sourceDirectory>
<resources>
<resource>
<directory>${project.build.sourceDirectory}</directory>

it doesn't work.

Issue Links

Activity

Hide
Jason Melnick added a comment -

This issue needs to be resolved to really get the most out of the inheritance model. If I've declared the <sourceDirectory> in a parent pom, the child should be able to use ${project.build.sourceDirectory} throughout.

Show
Jason Melnick added a comment - This issue needs to be resolved to really get the most out of the inheritance model. If I've declared the <sourceDirectory> in a parent pom, the child should be able to use ${project.build.sourceDirectory} throughout.
Hide
Jason van Zyl added a comment -

I'm going to write a little test case that uses the logic from the help:effective-pom plugin and a little xpath to make checking these things dead simple. It should be easy for users to give us a quick example of something not working.

Show
Jason van Zyl added a comment - I'm going to write a little test case that uses the logic from the help:effective-pom plugin and a little xpath to make checking these things dead simple. It should be easy for users to give us a quick example of something not working.
Hide
Brett Porter added a comment -

see linked issue - this works in 2.2.1 / 3.0-alpha-5

Show
Brett Porter added a comment - see linked issue - this works in 2.2.1 / 3.0-alpha-5

People

Vote (6)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: