Pass parameters to java main method using graddle

To pass for example a param “-a” with value “192.168.99.100:7051” to the static void main method that tha graddle task will run,  you will need to :

  • add following entry to gradle.build file, or assert that it is already there:
    run {
        if (project.hasProperty("appArgs")) {
            args = Eval.me(appArgs)
        }
    }
  • run graddle on the following form:
    gradle  run  -PappArgs="['-a',  '192.168.99.100:7051']"

Leave a Reply