Please can anyone explain me this gradle behaviour. I have a custom configuration:
configurations {
externalLibs
}
dependencies {
externalLibs group:'commons-logging',name:'commons-logging',version:'1.1.1'
}
sourceSets {
main {
compileClasspath += configurations.externalLibs
java { srcDir 'src' }
resources { srcDir 'src' }
}
}
task zipSharedLib(type: Zip) {
from configurations.externalLibs
{
exclude module: 'commons-logging'
}
}
I thought the exclude does only apply to the zip task, but if I execute the task, the library is missing on the compile too. I tried another solution for the exclude:
from configurations.externalLibs.files { file ->
file.name != 'xmlParserAPIs' && file.name != 'jstl' && file.name != 'commons-logging'
}
And this works as expected: The library is included during the compile but excluded from the zip. Can please someone explain the difference?