---- Guillaume Lederrey <[EMAIL PROTECTED]> schrieb:
> On 11/01/2008, Simon Kitching <[EMAIL PROTECTED]> wrote:
> > I've never really understood why the dependencyManagement section is useful 
> > at all.
> >
> > Why not just have each module declare the minimum version of a library that 
> > *it* needs in order to compile and pass the unit tests?
> >
> > Why would you ever want to omit the version tag? That just seems to be 
> > deliberate obfuscation.
> 
> It is important in some organizations (like where I am working now)
> where dependency management is not (and should not be) in the hand of
> the developers. The developers are handed a list of version that they
> should be using. If there is a clear separation of concern, it should
> be reflected in the code ...

IMO this is better handled by having a company repository that the parent pom 
points to, and having the default repos (repo1.maven.org etc) disabled. Then 
developers can only ever add dependencies into their poms that exist in the 
corporate repo. That's far more effective than just using dependencyManagement, 
which doesn't block child poms from (even accidentally) adding refs to 
artifacts that are not "permitted".

It's also possible for the parent pom to just define properties, that are 
referenced by child poms:
  <version>${foo.bar.version}</version>
To me this seems better than dependencyManagement as it is clear in the parent 
poms that something *must* be defining an explicit version (ie giving that 
property a value), and if it isn't then that results in a build error.

Regards,
Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to