I am trying to copy all my dependencies to a single directory while excluding a set of dependencies which are special. These special dependencies are actually plugins which I want in a separate directory. I’ve defined the special dependencies in the plugins property and then include or exclude when copying the dependencies.
project.ext {
plugins = [
'plugin-A-*.jar',
'plugin-B-*.jar',
'plugin-C-*.jar'
]
}
task copyLibs(type: Copy) {
into "$buildDir/lib"
from configurations.installer {
exclude project.plugins
}
}
task copyPlugins(type: Copy) {
into "$buildDir/bin"
from configurations.installer {
include project.plugins
}
}
The problem is that when executed all dependencies are copied to “$buildDir/lib” and nothing is copied to “$buildDir/bin”. So, it would appear that the include and/or the exclude is not working. Is there any reason why this would not work? How can I achieve what I want?