maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emeric MARTINEAU (JIRA)" <>
Subject [jira] (MRESOURCES-118) ${project.dependencies[0].artifactId} is not expanded by resource filtering
Date Wed, 10 Jul 2013 15:49:05 GMT


Emeric MARTINEAU commented on MRESOURCES-118:


I trie this,
<project xmlns="" xmlns:xsi=""
	<name>Kiko lolo</name>




and I have the result :
[INFO] Executing tasks
     [echo] [D:\DONNEES\emeric\workspace_eclipse\generique-projet-js\target\classes, D:\DONNEES\emeric\workspace_eclipse\.m2\repository\org\apache\maven\maven-plugin-api\2.0.6\maven-plugin-api-2.0.6.jar]
     [echo] maven-plugin-api
     [echo] maven-plugin-api
[INFO] Executed tasks

In src/main/resources I have a file :

I have result :

I think project.dependencies anly avaible in pom file.

If you see
I understand this properties only scope on pom not a all access properties.

Can you explain your use case ?
Why want this properties to understand this issue and

PS : I think MRESOURCES-31 Is duplicate of this issue.
> ${project.dependencies[0].artifactId} is not expanded by resource filtering
> ---------------------------------------------------------------------------
>                 Key: MRESOURCES-118
>                 URL:
>             Project: Maven 2.x 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="${}/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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message