[ 
https://jira.codehaus.org/browse/MRESOURCES-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=328892#comment-328892
 ] 

Emeric MARTINEAU commented on MRESOURCES-118:
---------------------------------------------

Hi,

after search, "project.dependencies[0].artifactId" and 
"project.compileClasspathElements" is not properties.

Is only avaible in plugin execution scope by plexus.
Properties are evaluate just after loading project, and if not found, there are 
not substitued.
Is not a maven resource bug, is how Maven/Plexus work.

I don't really understand why you need this but you may have this in file by 
implement your own filter by using "mavenFilteringHints" option.
See 
http://maven.apache.org/plugins/maven-resources-plugin/examples/custom-resource-filters.html
 for more information.

I think this bug and number 31 can be close.

Regards,
                
> ${project.dependencies[0].artifactId} is not expanded by resource filtering
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-118
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-118
>             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="${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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to