A module's resources appear in every module's jar artifact


(Zsolt Kúti) #1

Hello,

I noticed the subject in my project that has some modules containing nothing else than resources (like images, i18n). These modules uses java plugin and in their layout they define their content as resource like: /images/src/resources/… sourceSets {

main {

resources {

srcDir ‘src/resources’

}

}

The User Guide claims for java plugin resource management: “Copies production resources into the production classes directory” My classes go to: /build/production//// Resources however put under: /build/resources/main/… No /build/production/images can be seen.

For the “resource” modules their own jar artifacts are created, but beyond this these resources also appear in every module’s jar artifact.

How can I avoid this latter? Thanks! Zsolt


(Peter Niederwieser) #2

It’s expected that resources go into ‘/build/resources/main/’. The user guide needs to be updated here. If resources also appear in unrelated Jar artifacts, then something might be wrong with your build (scripts).