I have some curious project inheritance, where we use a Jar from some other project, but where we do overwrite some classes with the same name and package path as those in the jar. So the build task should be: - compile sources - jar sources into existing jar.
I have tried with overriding task jar like this:
task jar(type: Jar, overwrite: true) {
from zipTree(lib_xxx.xxx_bof_dep90)
from sourceSets.main.output.classesDir
}
This works as the jar task puts the compiled classes into the existing jar - but it leaves existing classes in that jar. So in effect, in the new jar I have duplicate classes.
How can I tell Gradle to overwrite existing classes with the ones just compiled?