You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Benson Margulies <bi...@gmail.com> on 2010/08/18 02:57:45 UTC

Property surprises in published POMS

Apache CXF has several poms that follow this pattern:


   ....
   <properties>
     <jetty.version>6.1.24</jetty.version>
   </properties>
   ...
   <dependencies>
     <dependency>
       <groupId>g</groupId>
       <artifactId>a</artifactId>
       <version>${jetty.version}</version>
     </dependency>
   </dependencies>

I was very surprised to learn, recently, that the release publication
process leaves the property reference in the POM. Then, if some
project of mine lists one of these projects as a dependency, and then
sets jetty.version to something else, CXFs dependencies follow along.
Oops. I somehow expected that the release process would resolve these
props and replace them with fixed values.

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


Re: Property surprises in published POMS

Posted by Wayne Fay <wa...@gmail.com>.
> What kind of problems was it causing?  Something to do with the idea of
> creating a resolved pom, or bugs in the implementation?
> Will it be added back in?  If so, is there any timeline for doing so?

Feel free to read the JIRA and the related JIRAs:
http://jira.codehaus.org/browse/MNG-2971

There appears to be a workaround that utilizes the assembly plugin,
but I've never tried it.

Wayne

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


RE: Property surprises in published POMS

Posted by "Haszlakiewicz, Eric" <EH...@transunion.com>.
>-----Original Message-----
>From: Wayne Fay [mailto:waynefay@gmail.com]
>
>> IMO, maven should probably create a "resolved pom" as part of the
build
>> process and deploy that along with the artifact, but I don't have
time
>> to figure out how to make it do that.
>
>This was done (briefly) in a few Maven versions and it caused a lot of
>problems, so it was pulled out/disabled.

What kind of problems was it causing?  Something to do with the idea of
creating a resolved pom, or bugs in the implementation?
Will it be added back in?  If so, is there any timeline for doing so?

Without this it looks like I'm going to have to go back to using ant or
make for my builds, at least to hack in a create-the-pom step before
running maven, but I'd really like to avoid having to do something like
that.

eric

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


Re: Property surprises in published POMS

Posted by Wayne Fay <wa...@gmail.com>.
> IMO, maven should probably create a "resolved pom" as part of the build
> process and deploy that along with the artifact, but I don't have time
> to figure out how to make it do that.

This was done (briefly) in a few Maven versions and it caused a lot of
problems, so it was pulled out/disabled.

Wayne

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


RE: Property surprises in published POMS

Posted by "Haszlakiewicz, Eric" <EH...@transunion.com>.
>-----Original Message-----
>From: Benson Margulies [mailto:bimargulies@gmail.com]
>Apache CXF has several poms that follow this pattern:
>
>   ....
>   <properties>
>     <jetty.version>6.1.24</jetty.version>
>   </properties>
>   ...
>   <dependencies>
>     <dependency>
>       <groupId>g</groupId>
>       <artifactId>a</artifactId>
>       <version>${jetty.version}</version>
>     </dependency>
>   </dependencies>
>
>I was very surprised to learn, recently, that the release publication
>process leaves the property reference in the POM. Then, if some
>project of mine lists one of these projects as a dependency, and then
>sets jetty.version to something else, CXFs dependencies follow along.
>Oops. I somehow expected that the release process would resolve these
>props and replace them with fixed values.

Maven doesn't have the concept of a difference between the pom used to
build the artifact, and the pom used to deploy it.  Many people (myself
included) have run into this problem, and there doesn't seem to be good
solution.
For limited things like the version of your artifact (not dependencies,
as in your example above) you can use the maven-release-plugin to
rewrite your pom(s) every time some version change, but I don't think
that'll replace arbitrary property references.
IMO, maven should probably create a "resolved pom" as part of the build
process and deploy that along with the artifact, but I don't have time
to figure out how to make it do that.

eric



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