On 18/01/2011, at 4:23 AM, Darren Evenson wrote:

> Hi,
>  
> Is there a way to exclude a transitive dependency from a shared project in 
> the same build?
>  
> So similar to this:
> dependencies {
>     compile("commons-jxpath:commons-jxpath:1.2") {
>         exclude group: 'xerces' module: 'xerces'
>     }
> }
>  
> I would like to be able to do this:
> dependencies {
>     compile project(':shared') {
>         exclude group: 'xerces' module: 'xerces'
>     }
> }
>  
> However, I can't get this to work, although I've tried many variations. Is 
> this possible?

The above is supposed to work, but it looks like we've broken it. You can do 
this, instead:

dependencies {
    compile (project(':shared')) {
        exclude group: 'xerces', module: 'xerces'
    }
}

Note the extra parentheses around the project() call.

Would you mind adding a jira issue for this problem?


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to