« Return to Thread: NPE when using exclude rules

Re: NPE when using exclude rules

by Rafael Serrano :: Rate this Message:

Reply to Author | View in Thread

Hi Hans,

Thanks for the quick reply. I over-simplified my use case and that example works, but I have just found the problem and it comes when using a flatDir resolver. Here is a failing script:
repositories {
        flatDir name: 'lib', dirs: "src/lib"
    mavenCentral().checkconsistency = false
}

configurations {
        all*.exclude group: "hsqldb"
}

dependencies {
        compile "dk.eobjects.commons:MetaModel:1.0.7"
        compile ":gdata-core:1.0"
}

task myTask << {
        configurations.testRuntime.each { file -> println file }
}

The problem seem to be that I can't reference any library with an empty group, so I have changed my dependency to:
compile "a:gdata-core:1.0"
but didn't moved my JAR, i.e. it was still under "src/lib", and it worked! This workaround is working for me, but anyway I'm gonna post a JIRA on this.

Thanks for your help. Regards
Rafa

hdockter wrote:
Hi Rafa,

I can't reproduce this. The following code works for me (MetaModel has  
a dependency on hsqldb):

usePlugin 'java'

repositories {
        mavenCentral()
}

configurations {
   all*.exclude group: "hsqldb"
}

dependencies {
        compile "dk.eobjects.commons:MetaModel:1.0.7"
}

task myTask << {
        configurations.testRuntime.each { file -> println file }
}

P.S. You don't need to quote the task name any more when creating it.

Could you create a test case and file a Jira?

- Hans

 « Return to Thread: NPE when using exclude rules