Custom jar task

(rtayek) #1

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/’ }

(Andrew Oberstar) #2

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

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

(rtayek) #3

works like a charm!