Re: Versions in dependencyManagement vs dependency?

2011-03-30 Thread Laird Nelson
On Wed, Mar 30, 2011 at 12:44 AM, Anders Hammar and...@hammar.net wrote:

 Be aware that you're talking of two different strategies. Using a pom
 artifact as a dependency and using import scope to import depMgmt declared
 in another pom. Two different things!


Yes, that's exactly my point.  I've seen import scope documented before, but
I've not seen simply having a dependency of type pom documented anywhere on
the Maven site.

Thanks,
Laird


Versions in dependencyManagement vs dependency?

2011-03-29 Thread Brinker, Don-NONEMP
Got a bit of an architecture/style question here.

I'm familiar with the use of the dependencyManagement block in a parent pom to 
fix versions of or otherwise configure a dependency.  However, except for cases 
which need it (for example, when transitive dependencies are otherwise pulling 
in two versions of the same JAR) I typically don't put versions there, but 
instead in the pom where I'm declaring the dependency itself.  I think this is 
pretty much SOP, if I'm not mistaken.

Now someone on my team has asked why we shouldn't put ALL versions in the 
parent POM (in dependencyManagement blocks, so as not to create additional 
dependencies).  While my initial gut reaction is that's a bad idea (since 
dependency info would then be in at least two places) I thought I'd see if 
anyone else there has tried this and has any pros or cons around the practice.

Thanks

-  Don


Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Stephen Connolly
it depends on how often you update versions and how often you will
release the parent.

if you update versions very often, but you don't want to release the
parent very often, then don't do it.

what I tend to do is aggregate the version info as high up in each
independently releasable tree.

On 29 March 2011 15:13, Brinker, Don-NONEMP dbrin...@collegeboard.org wrote:
 Got a bit of an architecture/style question here.

 I'm familiar with the use of the dependencyManagement block in a parent pom 
 to fix versions of or otherwise configure a dependency.  However, except for 
 cases which need it (for example, when transitive dependencies are otherwise 
 pulling in two versions of the same JAR) I typically don't put versions 
 there, but instead in the pom where I'm declaring the dependency itself.  I 
 think this is pretty much SOP, if I'm not mistaken.

 Now someone on my team has asked why we shouldn't put ALL versions in the 
 parent POM (in dependencyManagement blocks, so as not to create additional 
 dependencies).  While my initial gut reaction is that's a bad idea (since 
 dependency info would then be in at least two places) I thought I'd see if 
 anyone else there has tried this and has any pros or cons around the practice.

 Thanks

 -          Don


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



Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread juranta
Well, we put all the versions in the parent pom. It makes the versions easy
to change from the project's perspective. You don't have to browse through
many files to see where the dependency is declared. Also, two or more of the
sub-project may have a dependency on a same artifact, and if you put the
version in the parent pom, you have the version in only one place.

--
View this message in context: 
http://maven.40175.n5.nabble.com/Versions-in-dependencyManagement-vs-dependency-tp4269473p4269530.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Jörg Schaible
juranta wrote:

 Well, we put all the versions in the parent pom. It makes the versions
 easy to change from the project's perspective. You don't have to browse
 through many files to see where the dependency is declared. Also, two or
 more of the sub-project may have a dependency on a same artifact, and if
 you put the version in the parent pom, you have the version in only one
 place.

Same here. No version info in explicit dependencies.

- Jörg


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



Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Ron Wheeler
We follow Stephen's path but build aggregation poms that only contain 
libraries so that our project POMs only depend on our libraries.
For example if the war file needs the Apache Commons that we support in 
our development environment, the project will depend on the current 
version of ours-lib-commons.pom.
This reduces the project poms to 5-6 dependencies that are almost always 
the same so it is easy to start a new WAR project.


This provides central control (only 3 developers) over what versions are 
used and the JAR file produced by the library pom is shared in Tomcat 
and has provided scope in the WAR project so the war files are really 
small with only our code and WEB-INF files included. This makes the 
developers life easy since the versions of libraries are settled once 
for each release and are not a PITA for the programmer.


This saves a lot of time when building and deploying since we use web 
services and lots of other big tool kits that can take a 20K of classes, 
jsps, etc. and turn it into a 20M monster.

We have about 10 library POMs and over 50 war file POMs.

Ron

On 29/03/2011 12:39 PM, Jörg Schaible wrote:

juranta wrote:


Well, we put all the versions in the parent pom. It makes the versions
easy to change from the project's perspective. You don't have to browse
through many files to see where the dependency is declared. Also, two or
more of the sub-project may have a dependency on a same artifact, and if
you put the version in the parent pom, you have the version in only one
place.

Same here. No version info in explicit dependencies.

- Jörg


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





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



Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Laird Nelson
On Tue, Mar 29, 2011 at 1:22 PM, Ron Wheeler rwhee...@artifact-software.com
 wrote:

 We follow Stephen's path but build aggregation poms that only contain
 libraries so that our project POMs only depend on our libraries.
 For example if the war file needs the Apache Commons that we support in our
 development environment, the project will depend on the current version of
 ours-lib-commons.pom.


Just out of curiosity, where is it written down that one can depend on an
artifact of type pom?  I've always been curious about this.

L


Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Wendy Smoak
On Tue, Mar 29, 2011 at 1:59 PM, Laird Nelson ljnel...@gmail.com wrote:

 Just out of curiosity, where is it written down that one can depend on an
 artifact of type pom?  I've always been curious about this.

Are you asking about import scope?
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

-- 
Wendy

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



Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Laird Nelson
On Tue, Mar 29, 2011 at 2:01 PM, Wendy Smoak wsm...@gmail.com wrote:

 Are you asking about import scope?

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


I guess I am; is it required that when you're using import scope that the
type element be set to pom?

I assume, therefore, that type pom is not applicable anywhere else except
(a) inside a dependency management entry that (b) has scope import?

L


Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Ron Wheeler

On 29/03/2011 1:59 PM, Laird Nelson wrote:

On Tue, Mar 29, 2011 at 1:22 PM, Ron Wheelerrwhee...@artifact-software.com

wrote:
We follow Stephen's path but build aggregation poms that only contain
libraries so that our project POMs only depend on our libraries.
For example if the war file needs the Apache Commons that we support in our
development environment, the project will depend on the current version of
ours-lib-commons.pom.


Just out of curiosity, where is it written down that one can depend on an
artifact of type pom?  I've always been curious about this.

L

In the case that I described, the actual dependency is on the JAR.

The aggregation POM produces a JAR that is deployed in our Nexus and is 
available like any other third party library and installed in Tomcat's 
/lib as part of the application upgrade.


In the days of cloud servers, a Tomcat dedicated to one application is 
pretty easy to defend if anyone questions the possibility of library 
conflicts between applications.


Sorry for the confusion.
A bit of sloppy writing.
I will try to defend myself by characterizing my description as over 
abstracted.

We only use scope compile or provided.


Ron


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



Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Anders Hammar
Tim talks about this in this blog post:
http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-grouping-dependencies/

A pom artifact is an artifact like all others...it's just that the artifact
is the pom itself.

/Anders

On Tue, Mar 29, 2011 at 19:59, Laird Nelson ljnel...@gmail.com wrote:

 On Tue, Mar 29, 2011 at 1:22 PM, Ron Wheeler 
 rwhee...@artifact-software.com
  wrote:

  We follow Stephen's path but build aggregation poms that only contain
  libraries so that our project POMs only depend on our libraries.
  For example if the war file needs the Apache Commons that we support in
 our
  development environment, the project will depend on the current version
 of
  ours-lib-commons.pom.
 

 Just out of curiosity, where is it written down that one can depend on an
 artifact of type pom?  I've always been curious about this.

 L



Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Laird Nelson
On Tue, Mar 29, 2011 at 3:35 PM, Anders Hammar and...@hammar.net wrote:

 Tim talks about this in this blog post:

 http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-grouping-dependencies/


Thank you, yes, this is the first I've seen this documented.  So that seems
like you don't need scopeimport/scope in order to depend on an artifact
with typepom/type.  This is very useful to see.  I wish it were
documented more prominently.

Best,
Laird


Re: Versions in dependencyManagement vs dependency?

2011-03-29 Thread Anders Hammar
Be aware that you're talking of two different strategies. Using a pom
artifact as a dependency and using import scope to import depMgmt declared
in another pom. Two different things!

/Anders

On Tue, Mar 29, 2011 at 22:18, Laird Nelson ljnel...@gmail.com wrote:

 On Tue, Mar 29, 2011 at 3:35 PM, Anders Hammar and...@hammar.net wrote:

  Tim talks about this in this blog post:
 
 
 http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-grouping-dependencies/
 

 Thank you, yes, this is the first I've seen this documented.  So that seems
 like you don't need scopeimport/scope in order to depend on an artifact
 with typepom/type.  This is very useful to see.  I wish it were
 documented more prominently.

 Best,
 Laird