ext { browserMainClass = 'org.tmatesoft.sqljet.browser.DBBrowser' } artifacts { archives jar, sourcesJar sources sourcesJar } jar { manifest { attributes 'Main-Class' : browserMainClass } } << { String jarClasspath = '' configurations.compile.files.each { jarClasspath += it.name + ' ' } ant.jar(destfile: jar.archivePath, update: true) { delegate.manifest { attribute(name: 'Class-Path', value: jarClasspath.trim()) } } }