How to include src java files, classes, resources in separate directories in jar?

Hi,

I am trying to generate a jar using gradle/groovy code. However, my jar structure needs to be following:

new.jar
---------|src
---------|com
---------|res
---------|application.xml
---------|plugin.xml
---------|META-INF

However, when I add following code, all classes and src files and res get included under ‘src’ folder in jar

My code:

jar {
baseName = “new”
//from ‘sourceSets.resources.srcDirs’
//exclude ‘plugin-manifest.mf’
//from ‘sourceSets.main.output.classesDir’
//into ‘com’
//from ‘sourceSets.main.java.srcDirs’
//into ‘src’
from ‘src/main/java’
into ‘src’
manifest {
from ‘src/main/resources/plugin-manifest.mf’
}
}

please let me know how to generate jar with required str?