I'm using the sourceJar task to build a -sources bundle for a project.
It's an OSGi bundle and due to the project layout, the source set is defined as follows:
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
}
}
This is quite common actually. Using the sourceJar task then yields all files to be duplicated inside the resulting jar.
This can easily be fixed by doing this:
sourceJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
I'm just wondering whether it would make sense to include this option in the task definition already?