Skip to content

Instantly share code, notes, and snippets.

@ahndmal
Last active November 21, 2025 17:00
Show Gist options
  • Select an option

  • Save ahndmal/c5c00965567c55dd65efc65143a5fd5c to your computer and use it in GitHub Desktop.

Select an option

Save ahndmal/c5c00965567c55dd65efc65143a5fd5c to your computer and use it in GitHub Desktop.
plugins {
id 'java'
}
version = '1.0.0'
repositories {
mavenCentral()
}
dependencies {
implementation 'commons-io:commons-io:2.6'
}
tasks.jar {
manifest {
attributes["Main-Class"] = "com.andmal.Main"
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from sourceSets.main.output
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
tasks.register('uberJar', Jar) {
archiveClassifier = "uber"
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment