I need to pass in a commandline arg ("test") to my application using the gradle application plugin. All works if running as a standard Jar and passing in "-e test" however ive tried passing it in using the Gradle application plugin run task and as an Intellij gradle run config and the args always comes in as empty
I have tried passing command line args in using
gradle run --args '-e test'
This in the Intellij run config
-Dexec.args="test"
And this
-Pargs="test"
The args array is always empty when the program tries to start. How do I pass in "test" as a commandline argument
My entry point
public static void main(String[] args) {
CommandLine cl = processCommandLineArgs(args);
}