My first gradle build and have made progress but stuck at excluding some classes from a jar. Here is what I am using. But I see the final jar file still has the folders I want to exclude.
task agentJar(type: Jar) {
from sourceSets.main.output
exclude "**/common/**"
archiveBaseName = agentJarName;
includeEmptyDirs = false
}