Reputation: 29537
Gradle 2.14 and Groovy 2.4.7 here. I have the following Groovy:
@Slf4j
class Driver {
static void main(String[] args) {
log.info("Fizz prop value is: ${System.properties['fizz']}.")
}
}
I'm using the Gradle Application plugin. When I run:
./gradlew run -Pfizz=buzz
I get he following console output:
[main] INFO com.me.myapp.Driver - Fizz prop value is: null.
Why does my app think the fizz
property is null
, when I am passing its value as buzz
on the command-line?
Upvotes: 1
Views: 93
Reputation: 2966
try without the System.properties and passing -Pfizz=buzz:
log.info("Fizz prop value is: ${fizz}.")
Upvotes: 0
Reputation: 171114
You are passing it with -P
which are properties for gradle
Try passing it with -D
Upvotes: 1