Skip to content
Advertisement

Can’t pass parameters/sytem properties with gradlew command line

I try to pass parameters with gradlew command line, but can’t. I successfully pass the Optional parameter with XML file, but need have the possibility to pass with gradle CMD

Gradle task:

JavaScript

XML:

JavaScript

Code:

JavaScript

gradle CMD:

JavaScript
JavaScript

In both cases I get the same result: ipAmount=20, IP_AMOUNT_PARAMETER = null

How to correctly pass parameters from the gradle cmd?

Advertisement

Answer

As explained also in the comment!

All you need to do is:

JavaScript

Then you can pass the property using gradlew clean task1 -PipAmount=2

Finally the systemProperties is a map so you can add more variables like ["ipAmount", "anotherParam", "moreParam"]

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement