Please read this:

http://stackoverflow.com/questions/14725197/reading-properties-file-from-pom-file-in-maven/14727072#14727072

You will conclude that the only solution is to make the finalName a
configuration parameter of the mojo so that the recursive property
evaluation code can compute the effective final value on injection of the
final configuration before invoking the mojo.

An alternative solution would be to make the mojo pass the
project.getBuild.getFinalName() through the property interpolator before
use.

Sounds like a bug. A patch with tests would be good. Ping me if you write
one and I'll apply the patch (if it looks good) and run a release.
Alternatively, you could ask any of the people in the Committer School (
http://javaadventure.blogspot.ie/2012/07/do-you-want-to-become-maven-committer.html)
if they would like to take this as a task (ok we only have one person in
the committer school: Chris Graham, but don't let that stop you, we've had
a 50% graduation rate so far)

-Stephen

On 8 February 2013 17:02, Marshall Schor <m...@schor.com> wrote:

> We have a POM, where the <build> specifies a final name like this:
>
>
>
> <finalName>org.apache.uima.textmarker.engine_${parsedVersion.osgiVersion}</finalName>
>
> We use the maven-build-helper plugin to set the variable to be the same as
> the
> version, except with a period before the SNAPSHOT qualifier, for example.
>
> This works fine for plugins like the maven-jar-plugin - it nicely creates
> jars
> using the substituted value, e.g.
>  org.apache.uima.textmarker.engine_2.0.0.jar
>
> However, the maven-gpg-plugin, when copying the project's "pom.xml" file
> to the
> target/ to sign it, copies it to a file named like this:
>
>     File pomToSign = new File( project.getBuild().getDirectory(),
> project.getBuild().getFinalName() + ".pom" );
>     FileUtils.copyFile( project.getFile(), pomToSign )
>
> The code fragment: project.getBuild().getFinalName() must be getting the
> un-substituted/original version of the the finalName property, because we
> see
> the pom is copied into the target/ as
>     org.apache.uima.textmarker.engine_${parsedVersion.osgiVersion}.pom
>
> We know the property is being properly defined, etc., because earlier steps
> (like the maven-jar-plugin) use this and have the correct string (with the
> substituted value).
>
> How can we fix this?
>
> -Marshall Schor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to