spring-boot/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-build-image-env-proxy....

18 lines
411 B
Groovy

plugins {
id 'java'
id 'org.springframework.boot' version '{gradle-project-version}'
}
// tag::env[]
tasks.named("bootBuildImage") {
environment["HTTP_PROXY"] = "http://proxy.example.com"
environment["HTTPS_PROXY"] = "https://proxy.example.com"
}
// end::env[]
tasks.register("bootBuildImageEnvironment") {
doFirst {
bootBuildImage.environment.get().each { name, value -> println "$name=$value" }
}
}