You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (JIRA)" <ji...@apache.org> on 2015/12/31 23:14:39 UTC

[jira] [Closed] (MRESOURCES-118) ${project.dependencies[0].artifactId} is not expanded by resource filtering

     [ https://issues.apache.org/jira/browse/MRESOURCES-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Heinz Marbaise closed MRESOURCES-118.
------------------------------------------
    Resolution: Cannot Reproduce

> ${project.dependencies[0].artifactId} is not expanded by resource filtering
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-118
>                 URL: https://issues.apache.org/jira/browse/MRESOURCES-118
>             Project: Maven Resources Plugin
>          Issue Type: Bug
>          Components: interpolation
>    Affects Versions: 2.3, 2.4, 2.4.1
>         Environment: Maven 2.2.1, Ubuntu 9.10, Java 6u16 
>            Reporter: Pascal Thivent
>            Priority: Minor
>         Attachments: maven-resources-filtering-testcase.tar.bz2
>
>
> 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:
> {code:xml}
> <somenode>
>   <fileName>${project.dependencies[0].artifactId}</fileName>
>   <fileName>${myartifact}</fileName>
> </somenode>
> {code}
> Produces the following unexpected result:
> {code:xml}
> <somenode>
>   <fileName>${project.dependencies[0].artifactId}</fileName>
>   <fileName>${project.dependencies[0].artifactId}</fileName>
> </somenode>
> {code}
> The only working workaround I've found is to use the antrun plugin:
> {code:xml}
> <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>
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)