Skip to content

Instantly share code, notes, and snippets.

@priyanshus
Created April 30, 2020 11:11
Show Gist options
  • Save priyanshus/ed1a6eacf18a2314108d4b56c02ab750 to your computer and use it in GitHub Desktop.
Save priyanshus/ed1a6eacf18a2314108d4b56c02ab750 to your computer and use it in GitHub Desktop.
task uberJar(type: Jar) {
manifest {
attributes 'Main-Class': 'main.RunTest'
}
dependsOn configurations.runtimeClasspath
from sourceSets.main.output
from sourceSets.test.output
from sourceSets.main.resources
from sourceSets.test.resources
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
from {
project(':someothermoudule').sourceSets.main.resources // If current project depends on some other modules
project(':someothermoudule').sourceSets.test.resources // If current project depends on some other modules
}
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment