You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Paul Benedict <pb...@apache.org> on 2009/03/20 03:25:08 UTC

Scope for compile only?

Is there a way to bring in a library only for compiling without making
it part of the runtime (i.e., war dependency) or using transitive
exclusions? Java 5 has source-level annotations and sometimes a
dependency is only for compiling and has no runtime dependency. Is a
new scope needed for this?

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Scope for compile only?

Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Mar 19, 2009 at 7:25 PM, Paul Benedict <pb...@apache.org> wrote:
> Is there a way to bring in a library only for compiling without making
> it part of the runtime (i.e., war dependency) or using transitive
> exclusions? Java 5 has source-level annotations and sometimes a
> dependency is only for compiling and has no runtime dependency. Is a
> new scope needed for this?

It sounds like <optional>true</optional> would work.  (It's not a
scope, it's a separate element.)

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Scope for compile only?

Posted by Christian Edward Gruber <ch...@gmail.com>.
I would use "provided" which implies that the target runtime will  
provide this if needed.  It's not needed, but the semantic should  
work.  "Provided" scoped dependencies are not transitively added to  
packaging lifecycles like war and ear.

Also, this is probably a maven-users question, not a maven-developers  
list question.

Christian.

On 19-Mar-09, at 22:25 , Paul Benedict wrote:

> Is there a way to bring in a library only for compiling without making
> it part of the runtime (i.e., war dependency) or using transitive
> exclusions? Java 5 has source-level annotations and sometimes a
> dependency is only for compiling and has no runtime dependency. Is a
> new scope needed for this?
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Christian Edward Gruber
e-mail: christianedwardgruber@gmail.com
weblog: http://www.geekinasuit.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Scope for compile only?

Posted by Jörg Schaible <jo...@gmx.de>.
Paul Benedict wrote:

> Is there a way to bring in a library only for compiling without making
> it part of the runtime (i.e., war dependency) or using transitive
> exclusions? Java 5 has source-level annotations and sometimes a
> dependency is only for compiling and has no runtime dependency. Is a
> new scope needed for this?
> 
> Paul

Isn't "provided" doing this ?

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org