excluding transitive dependencies

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

excluding transitive dependencies

JerodLass
I make use of the dependency manager's resolve() method to get a list of all dependencies so that I can ensure my eclipse files and lib directories are all in sync.  If there is a specific dependency (example: org.springframework:spring) that for which I do not want the runtime dependencies to be resolved, how can I accomplish this?

Essentially, I want to explicitly disable a certain dependency's runtime dependencies.  Is this possible?  This would be similar to Maven's exclusions.

Jerod
Reply | Threaded
Open this post in threaded view
|

Re: excluding transitive dependencies

hans_d
Administrator

On Aug 12, 2008, at 11:56 PM, JerodLass wrote:

>
> I make use of the dependency manager's resolve() method to get a  
> list of all
> dependencies so that I can ensure my eclipse files and lib  
> directories are
> all in sync.  If there is a specific dependency (example:
> org.springframework:spring) that for which I do not want the runtime
> dependencies to be resolved, how can I accomplish this?
>
> Essentially, I want to explicitly disable a certain dependency's  
> runtime
> dependencies.  Is this possible?  This would be similar to Maven's
> exclusions.

Yes, it is possible. See user's guide 12.2.3 (Dependency Management/
Module Dependencies). There you can find the following example how to  
exclude dependencies.

dependencies {
    addDependency(['compile'], "org.codehaus.groovy:groovy-all:1.5.4") {
       exclude(module: 'jline')
       exclude(module: 'junit')
    }
}

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email