maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emeric MARTINEAU (JIRA)" <>
Subject [jira] (MRESOURCES-31) Dependency resolution for resource filtering
Date Tue, 03 Sep 2013 13:44:52 GMT


Emeric MARTINEAU commented on MRESOURCES-31:


you can't use :

Why ?

Two things.
You must make difference between, filtering (in file) and replace in pom.

In pom file, $\{project.dependencies[0].artifactId} work (exemple below) because, is use class
called org.apache.maven.plugin.PluginParameterExpressionEvaluator that use org.codehaus.plexus.util.introspection.ReflectionValueExtractor
that support index properties


when your are in filtering, is use class org.codehaus.plexus.interpolation.PrefixedObjectValueSource
that use org.codehaus.plexus.interpolation.ObjectBasedValueSource that org.codehaus.plexus.interpolation.reflection.ReflectionValueExtractor
that not support index properties.
You can see that exemple :
give :
project.dependencies=[Dependency {groupId=org.apache.maven, artifactId=maven-plugin-api, version=2.0.6,
type=jar}, Dependency {groupId=org.apache.maven, artifactId=maven-model, version=3.0.5, type=jar}]

give :

to change this way, org.apache.maven.shared.filtering.DefaultMavenFileFilter (method getReader)
must be change.
I don't know if easy to change that (what are side effect ?).

Maybe someone of maven team may provide his point of view ?
> Dependency resolution for resource filtering
> --------------------------------------------
>                 Key: MRESOURCES-31
>                 URL:
>             Project: Maven Resources Plugin
>          Issue Type: Wish
>    Affects Versions: 2.2
>            Reporter: Daniel Holmen
>            Priority: Minor
> I've been trying to use the project.compileClasspathElements  property in a filtered
resource, but discovered that Resources plugin isn't set up to require dependency resolution.
The result of this is that i cannot use any of the classpath properties in my filtered resources.
> The solution is quite simple, just add a @requiresDependencyResolution annotation to
ResourcesMojo. I have no idea if this causes any bad side-effects - but it seemed to work
properly when I tested it locally.

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