Custom jar task

him trying to add a custom jar task to my build (please see below).

the build works fine. the custom jar task is not finding any classes.


apply plugin: ‘java’ repositories { mavenCentral() } = [“src”] = [“tst”] sourceSets.main.resources.srcDirs = [“src”]

dependencies {

compile fileTree(dir: ‘lib’, includes: [’*.jar’])

testCompile group: ‘junit’,name:‘junit’,version: ‘4.8+’ }

task smallJar(type:Jar) {


from sourceSets.main.classes

include ‘com.tayek.hrm/’, 'com.tayek.qanda/’ }

Assuming you are trying to include only certain packages I think you would want:

include 'com/tayek/hrm/**/*', 'com/tayek/qanda/**/*'

works like a charm!