You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by maarten roosendaal <mr...@yahoo.com> on 2007/10/29 16:18:55 UTC

maven-release-plugin best practice question

Hi,

I'm working with the maven-release-plugin and it works fine except for the fact that my own <module>-<version>-SNAPSHOT dependencies in various pom.xml's do no get updated when performing a release:prepare.

I thought i could use the dependencyManagement for this but when i use this and do a release:prepare and start building, several modules will look for dependencies with the release version instead of the old SNAPSHOT version.

What is the (best) way to avoid having to manually change all the versionumbers in de dependencies in the pom.xml's (we have 12) before performing a release?

Thanks,
Maarten



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: maven-release-plugin best practice question

Posted by Nicole Lacoste <ni...@gmail.com>.
Hi Maarten,

We had the same problem and here's how we fixed it.  WARNING this is
probably not a best practice, more of a twisting mavens arm to get it to do
what we want.


0.  Prerequisite is that all the artifacts have the same version, the
version of the highest parent.

1.  We declare all the child projects in a dependency management section in
that highest parent pom, with their version <version>${project.version
}</version>

2. In the child poms when we declare the parent it is with the version of
the snapshot we are working on.

3. In the child poms we don't put a version, I think it actually picks up
the version from the parent, not from the dependency mangement, but I am not
sure of this.

4. If ever in a child pom we HAVE to give the version we use ${
project.version}.  (Note we do some very strange things with maven,
involving having child projects that are zips that other child projects
depend on and letting child projects depend on the javadocs or source of
child projects with the same parent.  This creates all kinds of problems
with the release, so we also call the install plugin and install these non
jar or jars with classifiers at the package phase.  It would be nice if
maven installed everything, not just jars during the release:prepare.)

I am curious to see other replies to your question!

Nicole


On 29/10/2007, maarten roosendaal <mr...@yahoo.com> wrote:
>
> Hi,
>
> I'm working with the maven-release-plugin and it works fine except for the
> fact that my own <module>-<version>-SNAPSHOT dependencies in various
> pom.xml's do no get updated when performing a release:prepare.
>
> I thought i could use the dependencyManagement for this but when i use
> this and do a release:prepare and start building, several modules will look
> for dependencies with the release version instead of the old SNAPSHOT
> version.
>
> What is the (best) way to avoid having to manually change all the
> versionumbers in de dependencies in the pom.xml's (we have 12) before
> performing a release?
>
> Thanks,
> Maarten
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

Re: maven-release-plugin best practice question

Posted by Graham Leggett <mi...@sharp.fm>.
On Mon, October 29, 2007 5:18 pm, maarten roosendaal wrote:

> I'm working with the maven-release-plugin and it works fine except for the
> fact that my own <module>-<version>-SNAPSHOT dependencies in various
> pom.xml's do no get updated when performing a release:prepare.
>
> I thought i could use the dependencyManagement for this but when i use
> this and do a release:prepare and start building, several modules will
> look for dependencies with the release version instead of the old SNAPSHOT
> version.
>
> What is the (best) way to avoid having to manually change all the
> versionumbers in de dependencies in the pom.xml's (we have 12) before
> performing a release?

If all 12 dependencies are typically released at the same time, then group
them together as a multi-module build and release the multi-module build
in one go.

We set the version in the root pom of our multi-module build, and in all
submodules, the version is inherited and accessed using ${pom.version}.

When the release:perform is run from the root of the multi-module build,
all the version numbers are handled automatically.

One thing that the release plugin likes to do when testing a multimodule
build is to miss out the install phase, which can cause potential
confusion as each of your submodules isn't installed and used by the next
submodule. To work around this problem, add this to your root pom:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.0-beta-6</version>
        <configuration>
          <preparationGoals>clean install</preparationGoals>
        </configuration>
      </plugin>

Regards,
Graham
--



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