Maven 2 & 3

Interpolation problem when using surefire

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4
  • Fix Version/s: 2.0.9
  • Labels:
    None
  • Complexity:
    Expert
  • Number of attachments :
    0

Description

I've just tried the cargo build with the latest trunk versions of 2.0.4-SNAPSHOT and surefire plugin, and it seems there's some interpolation issue (I don't know if the problem is with the surefire plugin or with maven core).

Here's what I have:

<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <forkMode>pertest</forkMode>
            <systemProperties>
              [...]
              <property>
                <name>cargo.target.dir</name>
                <value>${project.build.directory}</value>
              </property>
[...]

It seems the ${project.build.directory} property is no longer getting resolved as I got a directory named ${project.build.directory} created.

It used to work fine before.

Issue Links

Activity

Hide
John Casey added a comment -

test is it0104.

Show
John Casey added a comment - test is it0104.
Hide
John Casey added a comment -

fixing for 2.0.5, since this requires a new release of plexus-container-default.

The problem is in the handling of parameters of type java.util.Properties. The PropertiesConverter (used in plexus to coerce DOMs into Properties instances) doesn't use the expression evaluator on the values. I've fixed this in SVN, but the newest version of p-c-d could introduce significant risks into the 2.0.4 release of Maven, which is meant to be as quick as possible, to correct two glaring regressions.

Show
John Casey added a comment - fixing for 2.0.5, since this requires a new release of plexus-container-default. The problem is in the handling of parameters of type java.util.Properties. The PropertiesConverter (used in plexus to coerce DOMs into Properties instances) doesn't use the expression evaluator on the values. I've fixed this in SVN, but the newest version of p-c-d could introduce significant risks into the 2.0.4 release of Maven, which is meant to be as quick as possible, to correct two glaring regressions.
Hide
Wendy Smoak added a comment -

Re-opening as I'm seeing the same behavior again.

${basedir} works fine, as does ${project.build.finalName}, but if I use ${project.build.directory}, it is not expanded.

In http://svn.apache.org/repos/asf/shale/framework/trunk/shale-apps/shale-usecases/pom.xml if I change to:



<property>
<name>cargo.deployable</name>
<value>${project.build.directory}/${artifactId}.war</value>
</property>


It results in

[INFO] deployable: ${project.build.directory}/shale-usecases.war

Show
Wendy Smoak added a comment - Re-opening as I'm seeing the same behavior again. ${basedir} works fine, as does ${project.build.finalName}, but if I use ${project.build.directory}, it is not expanded. In http://svn.apache.org/repos/asf/shale/framework/trunk/shale-apps/shale-usecases/pom.xml if I change to:

<property> <name>cargo.deployable</name> <value>${project.build.directory}/${artifactId}.war</value> </property>

It results in [INFO] deployable: ${project.build.directory}/shale-usecases.war
Hide
Emmanuel Hugonnet added a comment -

I have seen it too in SURFIRE 2.2 with Mavn 2.0x built the 16/12/2006 and you don't have this problem with environmentVariables which means it is a Properties interpolation issue only.
Sorry for the http://jira.codehaus.org/browse/SUREFIRE-60 that duplicates this issue.
Emmanuel

Show
Emmanuel Hugonnet added a comment - I have seen it too in SURFIRE 2.2 with Mavn 2.0x built the 16/12/2006 and you don't have this problem with environmentVariables which means it is a Properties interpolation issue only. Sorry for the http://jira.codehaus.org/browse/SUREFIRE-60 that duplicates this issue. Emmanuel
Hide
Jason van Zyl added a comment -

Word is this works in 2.0.4 and now doesn't so that's bad. Checking now, putting back in 2.0.5 so I don't forget.

Show
Jason van Zyl added a comment - Word is this works in 2.0.4 and now doesn't so that's bad. Checking now, putting back in 2.0.5 so I don't forget.
Hide
Jason van Zyl added a comment -

Proven to be fixed with it0104.

Show
Jason van Zyl added a comment - Proven to be fixed with it0104.
Hide
Benjamin Bentmann added a comment -

The corresponding IT shows this doesn't work until 2.0.9. As John's fix to the PropertiesConverter in r3112 isn't part of plexus-container-default:1.0-alpha-9-stable-1, I guess it's merely the ModelInterpolator that fixed that.

Show
Benjamin Bentmann added a comment - The corresponding IT shows this doesn't work until 2.0.9. As John's fix to the PropertiesConverter in r3112 isn't part of plexus-container-default:1.0-alpha-9-stable-1, I guess it's merely the ModelInterpolator that fixed that.
Hide
Benjamin Bentmann added a comment -

For clarity: While expressions like {{${project.*}}} work in 2.0.9+, expressions like {{${settings.*}}} do not. The subtle difference being that the former are processed by the model interpolator, while the latter are processed by the plugin parameter expression evaluator but this is not invoked for java.util.Properties.

Show
Benjamin Bentmann added a comment - For clarity: While expressions like {{${project.*}}} work in 2.0.9+, expressions like {{${settings.*}}} do not. The subtle difference being that the former are processed by the model interpolator, while the latter are processed by the plugin parameter expression evaluator but this is not invoked for java.util.Properties.

People

Vote (1)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
4h
Original Estimate - 4 hours
Remaining:
4h
Remaining Estimate - 4 hours
Logged:
Not Specified
Time Spent - Not Specified