You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brian Agnew <br...@oopsconsultancy.com> on 2010/02/02 11:01:40 UTC

Publishing POMs via Maven and inserting build version info

Hello -

I posted the below to StackOverflow, then I figured that this may be a
better forum.

http://stackoverflow.com/questions/2183015/publishing-poms-via-maven-and-inserting-build-version-info

I'm building Maven projects via TeamCity/Git and trying to insert the
TeamCity build numbers in the pom.xml that gets published to my repository
upon a successful build. Unfortunately I can't determine how to publish a
pom.xml with the substitutions inserted.

My pom.xml contains info like:

<version>${build.number}</version>

where build.number is provided by TeamCity. That all builds ok, and if
(say) build.number = 0.1, then the deployment is a pom.xml to a directory
with 0.1. All well and good.

However, the pom.xml that is deployed is the pom.xml without the
substitutions made. i.e. Maven is running with a pom.xml with appropriate
substitutions, but deploys the initial version and so I get

<version>${build.number}</version>

in the final pom.xml. How can I get the build version number in the pom.xml ?

Apologies for the post length.

Brian

-- 
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Publishing POMs via Maven and inserting build version info

Posted by Stephen Connolly <st...@gmail.com>.
don't use property substitution in XPath:
    /project(/parent)?/(groupId|artifactId|version|packaging)
as they are not supported

On 2 February 2010 10:01, Brian Agnew <br...@oopsconsultancy.com> wrote:

> Hello -
>
> I posted the below to StackOverflow, then I figured that this may be a
> better forum.
>
>
> http://stackoverflow.com/questions/2183015/publishing-poms-via-maven-and-inserting-build-version-info
>
> I'm building Maven projects via TeamCity/Git and trying to insert the
> TeamCity build numbers in the pom.xml that gets published to my repository
> upon a successful build. Unfortunately I can't determine how to publish a
> pom.xml with the substitutions inserted.
>
> My pom.xml contains info like:
>
> <version>${build.number}</version>
>
> where build.number is provided by TeamCity. That all builds ok, and if
> (say) build.number = 0.1, then the deployment is a pom.xml to a directory
> with 0.1. All well and good.
>
> However, the pom.xml that is deployed is the pom.xml without the
> substitutions made. i.e. Maven is running with a pom.xml with appropriate
> substitutions, but deploys the initial version and so I get
>
> <version>${build.number}</version>
>
> in the final pom.xml. How can I get the build version number in the pom.xml
> ?
>
> Apologies for the post length.
>
> Brian
>
> --
> Brian Agnew                  http://www.oopsconsultancy.com
> OOPS Consultancy Ltd
> Tel: +44 (0)7720 397526
> Fax: +44 (0)20 8682 0012
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>