stack overflow
I started using some information from the proposed solution from the answer above: Approach to the application plugin
(build.gradle)
apply plugin: 'application' mainClassName = "com.mycompany.MyMain" run { args System.getProperty("exec.args").split() }
Command line:
gradle run -Dexec.args="arg1 arg2 arg3"
it works just as intended, but seems to have a side effect. It makes sense to pass command line arguments to run, but I have to pass them for each task, for example:
gradle tasks -Dexec.args="arg1 arg2 arg3"
If i leave
-Dexec.args="arg1 arg2 arg3"
I get
"build failed with an exception" Where:path\build.gradle line:18 which if where my run{ } is.
gradle
Travis
source share