You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marcus Linke <li...@newsaktuell.de> on 2010/09/16 17:07:44 UTC

Maven Release Plugin

Hello,

i 've the following problem releasing a multi-module project with the
maven-release-plugin (Version 2.0). The top (parent) pom-style project
defines a set of snapshot dependencies that are inherited to all of its
submodules. When using the release plugin in interactive mode, the plugin
prompts for the new versions of these snapshot dependencies. So far, so
good. But when diving into the submodules this is repeated for each module
again.  This is really annoying me because i have 20 submodules in that
project. Is this is a know problem or a type of misconfiguration.

Thanks

Marcus Linke


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


Re: Maven Release Plugin

Posted by Antonio Petrelli <an...@gmail.com>.
2010/9/16 Marcus Linke <li...@newsaktuell.de>:
> So the question is
> whether this behavior of the plugin should be changed or exists a usecase
> where submodules uses different versions of the same artifact.

Yes there is. In Velocity Tools we will have a default module that
depends on Velocity 1.6, while another module depends on future 2.0.

Antonio

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


Re: Maven Release Plugin

Posted by Nayan Hajratwala <na...@chikli.com>.
On Sep 16, 2010, at 2:01 PM, Marcus Linke wrote:

> Thanks for the replies first. The goal of declaring the dependencies in
> the parent pom project is to force all submodules to use these
> dependencies.

Is that really what you want?

For example:

	Module A depends on hibernate & commons-lang
	Module B depends on commons-lang & spring

In the parent module, are you declaring dependencies for hibernate, commons-lang & spring?  If so, then those dependencies are being unnecessarily included in the child modules. This could be a problem, particularly for WARs, where you'll end up with WEB-INF/lib bloat.


> When using <dependencyManagement> in parent pom each
> submodule have to declare this set of dependencies itself which seems
> really redundant to me.

This is The Maven Way. <dependencyManagement> is about *how* a particular dependency should be include *if* it is a <dependency> of a child module.

For example, in my projects, we don't use commons-logging, but prefer slf4j. As such, my <dependencyManagement> in the parent pom contains all the dependency version information as well as exclusions for hibernate, etc. Something like this:

	<dependency>
	  <groupId>org.springframework</groupId>
	  <artifactId>spring-hibernate3</artifactId>
	  <version>${spring.hibernate3.version}</version>
	  <exclusions>
	    <exclusion>
	      <groupId>commons-logging</groupId>
	      <artifactId>commons-logging</artifactId>
            </exclusion>
	  </exclusions>
	</dependency>

Now in the child poms, whenever I want to use spring-hibernate3, i simply have to add the following dependency, and it will get all the configuration from the parent:

	<dependency>
	  <groupId>org.springframework</groupId>
	  <artifactId>spring-hibernate3</artifactId>
	</dependency>


---
Nayan Hajratwala
http://agileshrugged.com
http://twitter.com/nhajratw
734.658.6032


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


Re: Maven Release Plugin

Posted by Marcus Linke <li...@newsaktuell.de>.
Thanks for the replies first. The goal of declaring the dependencies in
the parent pom project is to force all submodules to use these
dependencies. When using <dependencyManagement> in parent pom each
submodule have to declare this set of dependencies itself which seems
really redundant to me. By the way, when declaring the dependencies in
each submodule the maven-release-plugin behavior should be the same
(promting repeately for the same artifact versions). So the question is
whether this behavior of the plugin should be changed or exists a usecase
where submodules uses different versions of the same artifact.   

Regards 

Marcus

"Maven Users List" <us...@maven.apache.org> schreibt:
>I would agree that having dependencies in a POM project is curious,
>and cannot think of a good use case for them. Are you really looking
>for <dependencyManagement> where you can declare what versions should
>be used by inherited projects?
>
>On Thu, Sep 16, 2010 at 10:11 AM, Antonio Petrelli
><an...@gmail.com> wrote:
>> 2010/9/16 Marcus Linke <li...@newsaktuell.de>:
>>> i 've the following problem releasing a multi-module project with the
>>> maven-release-plugin (Version 2.0). The top (parent) pom-style project
>>> defines a set of snapshot dependencies that are inherited to all of its
>>> submodules. When using the release plugin in interactive mode, the
>plugin
>>> prompts for the new versions of these snapshot dependencies. So far, so
>>> good. But when diving into the submodules this is repeated for each
>module
>>> again.  This is really annoying me because i have 20 submodules in that
>>> project. Is this is a know problem or a type of misconfiguration.
>>
>> Sincerely having dependencies in a pom project is curious, definitely
>> I'd remove them.
>> I suppose that your modules have a precedence, i.e. a module depends on
>another.
>> If you play with transitive dependencies I think you'll get a clean
>> (and real) dependency tree.
>>
>> Antonio
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>



Mit freundlichen Grüßen

Marcus Linke

--

Softwareentwicklung, IT
news aktuell GmbH - Ein Unternehmen der dpa-Gruppe
Mittelweg 144, 20148 Hamburg
Tel: +49 (0)40-4113-2588
Fax: +49 (0)40-4113-2595

www.newsaktuell.de
www.presseportal.de

www.newsaktuell.de/blog
www.twitter.com/newsaktuell
www.youtube.com/newsaktuell 
www.facebook.com/pages/newsaktuell/152372075544
www.friendfeed.com/newsaktuell

--

Registergericht: Hamburg, Registernummer: HRB 42 738
Umsatzsteuer-Identifikationsnummer gemäß § 27 a Umsatzsteuergesetz:
DE118617411
Vertretungsberechtigte Personen: Carl-Eduard Meyer (Geschäftsführer),
Frank Stadthoewer (Geschäftsführer)


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


Re: Maven Release Plugin

Posted by Paul Benedict <pb...@apache.org>.
I would agree that having dependencies in a POM project is curious,
and cannot think of a good use case for them. Are you really looking
for <dependencyManagement> where you can declare what versions should
be used by inherited projects?

On Thu, Sep 16, 2010 at 10:11 AM, Antonio Petrelli
<an...@gmail.com> wrote:
> 2010/9/16 Marcus Linke <li...@newsaktuell.de>:
>> i 've the following problem releasing a multi-module project with the
>> maven-release-plugin (Version 2.0). The top (parent) pom-style project
>> defines a set of snapshot dependencies that are inherited to all of its
>> submodules. When using the release plugin in interactive mode, the plugin
>> prompts for the new versions of these snapshot dependencies. So far, so
>> good. But when diving into the submodules this is repeated for each module
>> again.  This is really annoying me because i have 20 submodules in that
>> project. Is this is a know problem or a type of misconfiguration.
>
> Sincerely having dependencies in a pom project is curious, definitely
> I'd remove them.
> I suppose that your modules have a precedence, i.e. a module depends on another.
> If you play with transitive dependencies I think you'll get a clean
> (and real) dependency tree.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Maven Release Plugin

Posted by Antonio Petrelli <an...@gmail.com>.
2010/9/16 Marcus Linke <li...@newsaktuell.de>:
> i 've the following problem releasing a multi-module project with the
> maven-release-plugin (Version 2.0). The top (parent) pom-style project
> defines a set of snapshot dependencies that are inherited to all of its
> submodules. When using the release plugin in interactive mode, the plugin
> prompts for the new versions of these snapshot dependencies. So far, so
> good. But when diving into the submodules this is repeated for each module
> again.  This is really annoying me because i have 20 submodules in that
> project. Is this is a know problem or a type of misconfiguration.

Sincerely having dependencies in a pom project is curious, definitely
I'd remove them.
I suppose that your modules have a precedence, i.e. a module depends on another.
If you play with transitive dependencies I think you'll get a clean
(and real) dependency tree.

Antonio

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


Re: Maven Release Plugin

Posted by Zac Thompson <za...@gmail.com>.
Two weeks late reading this, but I had to respond:
Marcus, favor composition over inheritance:

http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

I have myself forgotten about 'import' scope before, but it's
definitely the way to go.

On Fri, Sep 17, 2010 at 12:23 AM, Marcus Linke <li...@newsaktuell.de> wrote:
> Hello again. In my usecase all submodules SHOULD include a common set of
> dependencies. The submodules have no dependencies to other submodules.
> Thats why declaring the dependencies in the parent pom. The configuration
> option
>><autoVersionSubmodules>true</autoVersionSubmodules>
>  is only responsible to auto update the parent of all submodules.

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


Re: Maven Release Plugin

Posted by Marcus Linke <li...@newsaktuell.de>.
Hello again. In my usecase all submodules SHOULD include a common set of
dependencies. The submodules have no dependencies to other submodules.
Thats why declaring the dependencies in the parent pom. The configuration
option 
><autoVersionSubmodules>true</autoVersionSubmodules>
 is only responsible to auto update the parent of all submodules.
Independent from whether declaring the dependencies in the parent or in
the submodules the plugin should reuse dependency version mappings once
entered by the user for all subsequent/dependent modules. If it finds a
unmapped artifact/version in a module it can prompt the user for it and
reuse this mapping for the whole process without prompting again. This
behavior should work for all usecases, shouln't it?

Marcus

"Maven Users List" <us...@maven.apache.org> writes:
>The previous replies seem to miss the mark, your set up sounds good to
>me. The missing configuration you are looking for is:
>				<configuration>
>					<autoVersionSubmodules>true</autoVersionSubmodules>
>				</configuration>
>
>Kalle
>
>
>On Thu, Sep 16, 2010 at 8:07 AM, Marcus Linke <li...@newsaktuell.de>
>wrote:
>> Hello,
>>
>> i 've the following problem releasing a multi-module project with the
>> maven-release-plugin (Version 2.0). The top (parent) pom-style project
>> defines a set of snapshot dependencies that are inherited to all of its
>> submodules. When using the release plugin in interactive mode, the
>plugin
>> prompts for the new versions of these snapshot dependencies. So far, so
>> good. But when diving into the submodules this is repeated for each
>module
>> again.  This is really annoying me because i have 20 submodules in that
>> project. Is this is a know problem or a type of misconfiguration.
>>
>> Thanks
>>
>> Marcus Linke
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>



Mit freundlichen Grüßen

Marcus Linke

--

Softwareentwicklung, IT
news aktuell GmbH - Ein Unternehmen der dpa-Gruppe
Mittelweg 144, 20148 Hamburg
Tel: +49 (0)40-4113-2588
Fax: +49 (0)40-4113-2595

www.newsaktuell.de
www.presseportal.de

www.newsaktuell.de/blog
www.twitter.com/newsaktuell
www.youtube.com/newsaktuell 
www.facebook.com/pages/newsaktuell/152372075544
www.friendfeed.com/newsaktuell

--

Registergericht: Hamburg, Registernummer: HRB 42 738
Umsatzsteuer-Identifikationsnummer gemäß § 27 a Umsatzsteuergesetz:
DE118617411
Vertretungsberechtigte Personen: Carl-Eduard Meyer (Geschäftsführer),
Frank Stadthoewer (Geschäftsführer)


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


Re: Maven Release Plugin

Posted by Kalle Korhonen <ka...@gmail.com>.
The previous replies seem to miss the mark, your set up sounds good to
me. The missing configuration you are looking for is:
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
				</configuration>

Kalle


On Thu, Sep 16, 2010 at 8:07 AM, Marcus Linke <li...@newsaktuell.de> wrote:
> Hello,
>
> i 've the following problem releasing a multi-module project with the
> maven-release-plugin (Version 2.0). The top (parent) pom-style project
> defines a set of snapshot dependencies that are inherited to all of its
> submodules. When using the release plugin in interactive mode, the plugin
> prompts for the new versions of these snapshot dependencies. So far, so
> good. But when diving into the submodules this is repeated for each module
> again.  This is really annoying me because i have 20 submodules in that
> project. Is this is a know problem or a type of misconfiguration.
>
> Thanks
>
> Marcus Linke
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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