Quantcast

Relesa a project and all its snapshot dependencies, without an aggregator

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Relesa a project and all its snapshot dependencies, without an aggregator

Maxime Lemanissier
Hi all,

We are looking for a way to perform maven releases (via maven-release-plugin for example) on a project, and all its dependencies which are in a snapshot version (internal dependencies).

Using a pom aggregator and ${project.version} in dependencyMgmt for all internal dependencies allows such process, but the drawback is we have to regroup projects within this aggregator, according to the dependency graph.

We would like to be able to do the same thing, but without having to use an aggregator (that add another link between projects, than their dependencies).
The process would be the same than with an aggregator, but instead of building a maven reactor with modules, it would be done among snapshot dependencies.

Scm element is set in all the pom, so maven can find where dependencies sources are.

Do you know a way to do this?
If no, does this seem feasible? Could maven-release-plugin manage this with a new parameter ? (releaseSnapshotDependencies=true for example)

Thx
Maxime


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Relesa a project and all its snapshot dependencies, without an aggregator

stephenconnolly
What I would like to see is that when a project explicitly specifies
it's scm information, that m-release-p would treat that as a
separately releasable item... so that if you have an aggregator
project with no scm information, m-r-p would (perhaps with some
hinting) see that as not requiring a release... it would then search
through the reactor and pick up the projects that explicitly define
scm info, and start releasing and tagging those one at a time....

there are issues with the above....

1. what do you do when you have cycles in scm that make such a release
impossible?
2. introduces a tight coupling between maven release plugin and the
build plan... and tight coupling is evil.
3. Makes rollback harder to achieve...
etc

These are not insurmountable, but feel more like m-r-p 3.0 features
rather than m-r-p 2.3 or certainly 2.x features.

Have a look through the jira's
http://jira.codehaus.org/browse/MRELEASE and see if there is something
similar... if not please raise a JIRA for this feature.

Thanks,

-Stephen

On 27 June 2011 10:05, maxime.lem <[hidden email]> wrote:

> Hi all,
>
> We are looking for a way to perform maven releases (via maven-release-plugin
> for example) on a project, and all its dependencies which are in a snapshot
> version (internal dependencies).
>
> Using a pom aggregator and ${project.version} in dependencyMgmt for all
> internal dependencies allows such process, but the drawback is we have to
> regroup projects within this aggregator, according to the dependency graph.
>
> We would like to be able to do the same thing, but without having to use an
> aggregator (that add another link between projects, than their
> dependencies).
> The process would be the same than with an aggregator, but instead of
> building a maven reactor with modules, it would be done among snapshot
> dependencies.
>
> Scm element is set in all the pom, so maven can find where dependencies
> sources are.
>
> Do you know a way to do this?
> If no, does this seem feasible? Could maven-release-plugin manage this with
> a new parameter ? (releaseSnapshotDependencies=true for example)
>
> Thx
> Maxime
>
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Relesa-a-project-and-all-its-snapshot-dependencies-without-an-aggregator-tp4527536p4527536.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Relesa a project and all its snapshot dependencies, without an aggregator

Maxime Lemanissier
Problems with aggregator is that it imposes the structure of your projects. I would like to put my projects sources as I want and not as Maven aggregator wants.
Another problem with aggregator is when a project is used within several others projects (common dependencies). In this case, under which aggregator sources should be put? Just one? What about if this aggregator does not need to be released, but another project needs this common dependency to be released. Put it in all projects

Another way to make it would be to change the way modules are managed. Not use physical path but artifact coordinates.

Instead of
<modules>
  <module>module1</module>
  <module>../../module2</module>
  ...
</modules>

we would have

<modules>
  <module>
    <groupId>com.mycompany</groupId>
    <artifactId>module1</artifactId>
    <version>${project.version}</version>
  </module>
  ...
</modules>


But this might duplicate dependencies information. So why don't release according to dependencies directly?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Relesa a project and all its snapshot dependencies, without an aggregator

stephenconnolly
I think you mis-understand how I am suggesting you use the aggregator pom....

I am suggesting that you have a local aggregator pom one level up...
you don't need to check that pom out at all. You just use that pom
locally to group all the source you have checked out and construct a
reactor from the checkout...

Maven (at least 3.0.x) will build the modules in dependency order, not
in module order.

On 27 June 2011 10:38, maxime.lem <[hidden email]> wrote:

> Problems with aggregator is that it imposes the structure of your projects. I
> would like to put my projects sources as I want and not as Maven aggregator
> wants.
> Another problem with aggregator is when a project is used within several
> others projects (common dependencies). In this case, under which aggregator
> sources should be put? Just one? What about if this aggregator does not need
> to be released, but another project needs this common dependency to be
> released. Put it in all projects
>
> Another way to make it would be to change the way modules are managed. Not
> use physical path but artifact coordinates.
>
> Instead of
> <modules>
>  <module>module1</module>
>  <module>../../module2</module>
>  ...
> </modules>
>
> we would have
>
> <modules>
>  <module>
>    <groupId>com.mycompany</groupId>
>    <artifactId>module1</artifactId>
>    <version>${project.version}</version>
>  </module>
>  ...
> </modules>
>
>
> But this might duplicate dependencies information. So why don't release
> according to dependencies directly?
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Relesa-a-project-and-all-its-snapshot-dependencies-without-an-aggregator-tp4527536p4527637.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Relesa a project and all its snapshot dependencies, without an aggregator

Maxime Lemanissier
> I am suggesting that you have a local aggregator pom one level up...
> you don't need to check that pom out at all. You just use that pom
> locally to group all the source you have checked out and construct a
> reactor from the checkout...

OK, but you have to write a pom just for the current release, based on what you want to release.
I would like just to press a button (i'm using jenkins plugin for maven releases) to release a project. If this project has non release dependencies, well, release them just before, update the version of these dependencies in the pom of the project, and release this project.

> Maven (at least 3.0.x) will build the modules in dependency order, not
> in module order.

Yes, Maven 2 already does this.

What I'm currently is a script that calls mvn release:prepare release:perform on each project I want to release, in the same order than Maven reactor is giving me.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Relesa a project and all its snapshot dependencies, without an aggregator

Maxime Lemanissier
enhancement request submitted: http://jira.codehaus.org/browse/MRELEASE-688
Loading...