I have a spring boot project using gradle
apply plugin: \'java\'
apply plugin: \'idea\'
apply plugin: \'jetty\'
apply plugin: \'war\'
apply plugin: \'org.spr
fatJar
in build.gradle
:jar {
baseName = 'base-name'
version = '0.1.0'
manifest {
attributes(
'Main-Class': 'com.github:'
)
}
}
task fatJar(type: Jar) {
manifest.from jar.manifest
// classifier = 'all'
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}
artifacts {
archives fatJar
}
gradle fatJar
or ./gradlew fatJar
to generate a jar
file with all dependencies, which can run independently but may be pretty large in size (that's why it's called a fat jar).