commit
94884f201c
@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
// tag::system-property[]
|
||||
bootRun {
|
||||
systemProperty 'com.example.property', findProperty('example') ?: 'default'
|
||||
}
|
||||
// end::system-property[]
|
||||
|
||||
task configuredSystemProperties {
|
||||
doLast {
|
||||
bootRun.systemProperties.each { k, v ->
|
||||
println "$k = $v"
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
import org.springframework.boot.gradle.tasks.run.BootRun
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version}"
|
||||
}
|
||||
|
||||
// tag::system-property[]
|
||||
tasks.getByName<BootRun>("bootRun") {
|
||||
systemProperty("com.example.property", findProperty("example") ?: "default")
|
||||
}
|
||||
// end::system-property[]
|
||||
|
||||
task("configuredSystemProperties") {
|
||||
doLast {
|
||||
tasks.getByName<BootRun>("bootRun").systemProperties.forEach { k, v ->
|
||||
println("$k = $v")
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue