You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Haroon Rafique <ha...@utoronto.ca> on 2010/05/14 20:02:58 UTC
Maven 3.0-beta-1 backwards compatibility issue with maven-resources-plugin
Hi,
Just tried out one of my projects with 3.0-beta-1 and discovered an issue
which I would like help on. The issue boils down to "when and how is
targetPath resolved in maven-resources-plugin" in 3.0-beta-1 versus 2.2.1.
I have a bare-bones POM and a couple of text files that can demonstrate
the issue which I can attach to a JIRA (if requested).
My <resources> section looks like:
<resources>
<resource>
<directory>src/main/resources</directory>
<targetPath>../${app.key}</targetPath>
<filtering>true</filtering>
</resource>
</resources>
My plugins section has properties-maven-plugin bringing properties into
the project (only single property app.key). The configuration is as
follows:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<id>read-project-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>src/main/filters/site.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
Finally, my filter section is as follows:
<filters>
<filter>src/main/filters/site.properties</filter>
</filters>
site.properties has only 1 line:
app.key=projectA
So, in maven 2.2.1 (mvn clean process-resources), I am expecting 2 things
(works as expected):
a) contents of src/main/resources should be filtered using site.properties
b) contents of src/main/resources should be copied to target/projectA
In maven 3.0-beta-1, with the same POM and files:
a) contents of src/main/resources are filtered using site.properties
b) *PROBLEM* contents of src/main/resources are copied to
target/${app.key}
If I run maven 3.0-beta-1 with -X switch "mvn -X clean process-resources",
I do see properties-maven-plugin having done its job, as app.key does show
up with value projectA in the "[DEBUG] properties used" line.
Where should I concentrate?
a) maven-3.0-beta-1
b) properties-maven-plugin in conjunction with maven-3.0-beta-1
c) maven-resources-plugin in conjunction with maven-3.0-beta-1
Any help is appreciated.
Thanks,
--
Haroon Rafique
<ha...@utoronto.ca>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven 3.0-beta-1 backwards compatibility issue with maven-resources-plugin
Posted by Benjamin Bentmann <be...@udo.edu>.
Haroon Rafique wrote:
> Anything else I can do? Sample project with POM in a JIRA?
Thanks but we already have an integration test for the related issue
MNG-3530.
Benjamin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven 3.0-beta-1 backwards compatibility issue with
maven-resources-plugin
Posted by Haroon Rafique <ha...@utoronto.ca>.
On Today at 4:19pm, BB=>Benjamin Bentmann <be...@udo.edu> wrote:
BB> Haroon Rafique wrote:
BB>
BB> > <resources>
BB> > <resource>
BB> > <directory>src/main/resources</directory>
BB> > <targetPath>../${app.key}</targetPath>
BB> > <filtering>true</filtering>
BB> > </resource>
BB> > </resources>
BB> >[...]
BB> > a) maven-3.0-beta-1
BB> > b) properties-maven-plugin in conjunction with maven-3.0-beta-1
BB>
BB> This setup requires a questionable feature [0] to work. Questionable because
BB> it decreases performance but serves only few use cases. It's not yet clear
BB> whether it will be supported in 3.x.
BB>
BB>
BB> Benjamin
BB>
BB>
BB> [0] http://docs.codehaus.org/display/MAVEN/Dynamic+POM+Build+Sections
BB>
Thanks for the link. I read the page and it makes sense.
Here's another data point. This feature didn't work in 2.0.9 and did work
fantastically in 2.2.1. Not sure about 2.0.10 or 2.1.x as I jumped from
2.0.9 straight to 2.2.1.
Anything else I can do? Sample project with POM in a JIRA?
Cheers,
--
Haroon Rafique
<ha...@utoronto.ca>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven 3.0-beta-1 backwards compatibility issue with maven-resources-plugin
Posted by Benjamin Bentmann <be...@udo.edu>.
Haroon Rafique wrote:
> <resources>
> <resource>
> <directory>src/main/resources</directory>
> <targetPath>../${app.key}</targetPath>
> <filtering>true</filtering>
> </resource>
> </resources>
>[...]
> a) maven-3.0-beta-1
> b) properties-maven-plugin in conjunction with maven-3.0-beta-1
This setup requires a questionable feature [0] to work. Questionable
because it decreases performance but serves only few use cases. It's not
yet clear whether it will be supported in 3.x.
Benjamin
[0] http://docs.codehaus.org/display/MAVEN/Dynamic+POM+Build+Sections
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org