In my build script, after the classes are compiled, I need to construct a jar containing the compiled classes, and also the contents of “src/main/resources”, but instead of copying everything in “src/main/resources” into the root of the jar, I need them all copied into the “META-INF” folder of the jar. Actually, in my project there is a subfolder of “src/main/resources” that I actually care about, and that folder needs to be copied into the META-INF folder. Technically, if I had other files in “src/main/resources” besides that one folder, I would be fine with those being copied into the root of the jar, as long as that one subfolder is copied to the “META-INF” folder.
I’ve tried the following:
jar {
from ("src/main/resources/yang") {
into ("META-INF/yang")
}
}
This sort of works. The files in “src/main/resources/yang” do get copied into “META-INF/yang” in the jar. However, those same files are also copied into a “yang” folder in the root directory of the jar. Those are just wasting space. I’d prefer that those files not be in the resulting jar in that location, only in the “META-INF/yang” folder.