and we have the problem, that the generated jar file has everything dupicated. Class files and resources. And I saw that we can’t change the source property of the jar task because it’s read only. How can we achieve that the standard jar task of the java plugin creates a correct jar file?
I have to do this in multiple subprojects, some of which have different source sets (i.e. not main). Is there a way I can ‘decorate’ the appropriate jar tasks with workaround? Otherwise I have to copy/paste it in all my subprojects
Also, I’m curious why exactly that works? It seems like the second call to main.output.resourcesDir should unset the first? I guess there’s something I don’t understand about the jar/resources lifecycle.