Setting resources root in jar

Hello. When I compile my project, resources are put in the root of the generated artifact. How can I put it in another folder in the jar like /assets ?

I tried to rename the build/resources/main directory between processResources and shadowJar (it does not work with the jar task too) without success.

Any idea ?

Just put them in src/main/resources/assets

I would like to to dit without adding a new folder because this directory could be renamed between different builds.

I’d advise against copying from src/main/resources into the assets folder as this would fail the Principal of Least Surprise. So perhaps use a different folder(s). Eg:

processResources {
   into('assets') {
      from 'src/main/assets'
      from 'some/other/path'