Reputation: 40530
I'm using Spring Boot (1.0.0.RELASE) and I want to create a distribution zip file containing the following:
Preferable I would like this zip file to be created when running "gradle build" (but another task is fine if this is hard to achieve). Is there nice way to achieve this?
Upvotes: 8
Views: 5828
Reputation: 40530
I did something similar to what Dave Syer suggested:
task zip(type: Zip, dependsOn: bootRepackage) {
def fileName = "${jar.baseName}-${jar.version}"
from projectDir
include "script.sh"
from file("$buildDir/libs")
include "${fileName}.jar"
from file('src/dist')
include "config/application.yml"
archiveName "${fileName}.zip"
}
build.dependsOn(zip)
Any improvement suggestions are welcome.
Upvotes: 3
Reputation: 58094
Something like this?
task zip(type: Zip, dependsOn: bootRepackage) {
from('build/libs') {
include '*.jar'
}
from 'conf'
}
build.dependsOn(zip)
Upvotes: 11