Also, in the context of a WAR project, <scope>provided</scope> and
<optional>true</optional> have different semantics when it comes to
inclusion in the manifest's Class-Path or not.

(See:
http://maven.apache.org/plugins/maven-war-plugin/examples/war-manifest-guide.html
)

In my experience, it is usually better to mark dependencies in a JAR
project as <optional>true</optional>, since provided scope would be a
strong assumption about the context that the JAR is going to be used in.

YMMV.

-Olivier

On Fri, 2008-05-09 at 19:45 -0400, Brian E. Fox wrote:
> Optional is meant if you have several dependencies that you need to
> compile, but that a user of your jar might only need one of (think
> oracle vs mssql bindings).
> 
> -----Original Message-----
> From: Paul Smith [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 09, 2008 4:42 PM
> To: Maven Users List
> Subject: Re: Dependency scope - provided or optional.. ?
> 
> 
> On 10/05/2008, at 9:38 AM, Brianefox wrote:
> 
> > Provided means to include in the compile do but not in the package  
> > (war)
> > Optional means that it wont be pulled in transitively by users of  
> > your jar
> >
> 
>  From this, I gather Optional is actually what we want.  Would it be  
> fair to say that Optional is a sort of extension to provided.  Whereas  
> Provided indicates that it is actually needed downstream, but the  
> downstream projects need to arrange their own bundling of it.  A  
> dependency marked as Provided still indicates to the downstream  
> project that they need it to run it.
> 
> Would you agree that Optional is what we want for log4j?
> 
> cheers,
> 
> Paul
> 
> ---------------------------------------------------------------------
> 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]
> 


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

Reply via email to