Spring needs to declare the dependency like this (as far as I know):

<dependency>
  <groupId>something</groupId>
  <artifactId>something-optional</artifactId>
  <optional>true</optional>
</dependency>

I think in most cases where you'd need multiple exclusions the actual
case is that you don't want to add the dependency, because you don't
want it in your war, or something like that, but you actually still do
transitively depend on it.  In that case you should declare the
dependency yourself, and set: <scope>provided</scope>.

I would like however, for <dependencyManagement> in a parent POM with
scope set to provided to apply to a transitive dependency.  I don't 
think it does though.

-Stephen

On 10/21/05, Nicolas De Loof <[EMAIL PROTECTED]> wrote:
>
> Another thing that is painful : if I exclude a common jar from one
> dependency (let's say logkit as it uses commons-logging) another
> dependency can also add it to my dependencies and I have to copy my
> exclusion rule.
>
> about adding a jira issue for MEV, what would be the syntax to make a
> dependency OPTIONAL ?
>
> Consider spring-remoting : it's a toolkit to be used with hessian,
> burlap, jax-rpc, ejb or jms.
> Solution 1 : convince Spring developpers to cut it into 6 specialized
> jars (all those + commons)
> Solution 2 : have a way to declare those dependencies as optional. This
> make madatory to declare a dependency in final app, but this avoid lot's
> of exclusion rules.
>
>
> Nicolas De Loof a écrit :
>
> >
> > But thos poms are NOT invalid :
> >
> > spring-web requires spring-core + beans + context, that themselves
> > depends on lot's of tools that spring supports.
> >
> > My WEB-INF/lib has 44 jars, and I only require 10 of them.
> >
> > Another problem is that I cannot set exclusion at top level : I need
> > to know what dependency has introduced some jar,  + detecte the
> > groupId from the jar name (that can be != from artifactId)
> >
> > I'll take me lo'ts of time !
> >
> > Matt Raible a écrit :
> >
> >> On 10/21/05, Nicolas De Loof <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>> Hi,
> >>>
> >>> My webapp uses spring and transitive dependencies (that is a cool
> >>> feature) adds tons of dependencies to my war.
> >>> I have to setup lot's of exclusions rules... more than dependencies I
> >>> have in my project !
> >>>
> >>> Is there any way to make this quicker, perhaps some regexp matching
> >>> exclusion/inclusion rule ?
> >>>
> >>
> >>
> >> The problem is primarily metadata and that it's not accurate in the
> >> dependeny POMs.  I agree with you whole-heartedly.  I've found that I
> >> have to exclude a *lot* from Hibernate, iBATIS, JDO and Display Tag.
> >>
> >> In an ideal world, we'd never have to put exclusions on any of our
> >> dependencies.  If enough users complain about this - hopefully it'll
> >> get fixed.  In the meantime, your best bet is to enter invalid POMs as
> >> bugs in JIRA:
> >>
> >> http://jira.codehaus.org/browse/MEV
> >>
> >> HTH,
> >>
> >> Matt
> >>
> >>
> >>
> >>> Nico.
> >>>
> >>>
> >>> This message contains information that may be privileged or
> >>> confidential and is the property of the Capgemini Group. It is
> >>> intended only for the person to whom it is addressed. If you are not
> >>> the intended recipient,  you are not authorized to read, print,
> >>> retain, copy, disseminate,  distribute, or use this message or any
> >>> part thereof. If you receive this  message in error, please notify
> >>> the sender immediately and delete all  copies of this message.
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >
> > This message contains information that may be privileged or
> > confidential and is the property of the Capgemini Group. It is
> > intended only for the person to whom it is addressed. If you are not
> > the intended recipient,  you are not authorized to read, print,
> > retain, copy, disseminate,  distribute, or use this message or any
> > part thereof. If you receive this  message in error, please notify the
> > sender immediately and delete all  copies of this message.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> This message contains information that may be privileged or confidential and 
> is the property of the Capgemini Group. It is intended only for the person to 
> whom it is addressed. If you are not the intended recipient,  you are not 
> authorized to read, print, retain, copy, disseminate,  distribute, or use 
> this message or any part thereof. If you receive this  message in error, 
> please notify the sender immediately and delete all  copies of this message.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Stephen Duncan Jr
www.stephenduncanjr.com

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

Reply via email to