Override the dependency defined in the POM, as Steve outline in his earlier response. Let me quote his explanation for ease of reference:
"E.g. if project P has test scoped dependency to a LIB1, and compile scoped dependency to LIB2, while LIB2 has compile scope dependency to LIB1, currently project P's war will wrongly end up without LIB1 included. In P one expects LIB1 to be available for testing, but that shouldn't affect availability of LIB1 as compile scoped transitive dependency, it should be the other way round, in this case scope of declared test scoped dependency should be broadened." I used the term "override" to descibe the situation when project P should have LIB1 defined as a compile dependency, when the POM actually defines it as test. But it should should only override for test dependencies, not for provided or runtime. As for your "lost me" comment I am not sure what you would like explained. Scope basically has multiple meanings. Compile/test are both related to requiring a dependency for compilation; runtime/provided are both related to requiring a dependency only at runtime. These multiple meanings are not suited to a single variable. --- Todd Thiessen > -----Original Message----- > From: Brian Fox [mailto:[email protected]] > Sent: Friday, May 08, 2009 11:00 AM > To: Maven Users List > Subject: Re: Re: Transitive and inherited dependencies - > potential bug, or my misunderstanding of the mechanism > > 2009/5/8 Todd Thiessen <[email protected]> > > > Your argument Jorg I think applies to provided and runtime > scope, but > > not to test. > > > > The root smell here lies in the definition of "scope". Test scope > > means needed to compile test code. Compile scope means needed to > > compile production and test code. These are both related to when a > > dependency is needed to compile. > > > > Provided and runtime scope are related to when a dependency > is needed > > at runtime. > > > > So the way I see it, a compile transitive dependency should always > > override a test dependency but not provided or runtime. > > > > What do you mean by override? > > > > > > There is some technical debt here in terms of how scoping > works. You > > really need a further scope classification like: > > > > Scope = compile > > classifier = test > > classifier = production > > > > Scope = runtime > > classifier = provided > > > > Something like this. You likely get the idea. > > > > Lost me.... > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
