Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.3, 2.4, 2.4.1
-
Fix Version/s: None
-
Component/s: interpolation
-
Labels:None
-
Environment:Maven 2.2.1, Ubuntu 9.10, Java 6u16
-
Number of attachments :
Description
When filtering resources, $
{project.dependencies[0].artifactId} is not expanded (remains unchanged in the output file).I've tried to define a property in my pom to workaround this issue:
<properties>
<myartifact>${project.dependencies[0].artifactId}
</myartifact>
</properties>
But, still, filtering the following file:
<somenode> <fileName>${project.dependencies[0].artifactId}</fileName> <fileName>${myartifact}</fileName> </somenode>
Produces the following unexpected result:
<somenode> <fileName>${project.dependencies[0].artifactId}</fileName> <fileName>${project.dependencies[0].artifactId}</fileName> </somenode>
The only working workaround I've found is to use the antrun plugin:
<plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>process-resources</phase> <configuration> <tasks> <echo>${project.dependencies[0].artifactId}</echo> <echo>${artifactId}</echo> <replace file="${project.build.outputDirectory}/my.xml" token="@@@" value="${project.dependencies[0].artifactId}"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>
I didn't test all cases but this problem may affect all "indexed" properties (as defined in PLXUTILS-37).
I'm attaching a sample project demonstrating this problem.
Issue Links
- relates to
-
MRESOURCES-31
Dependency resolution for resource filtering
-