Open ellerycrane opened 11 years ago
The fault for this appears to be in the GrailsScriptRunner; the GrailsLauncher is calling this executeCommand
:
public int executeCommand(String scriptName, String args) {
return executeCommand(scriptName, args, null);
}
Normally, the GrailsScriptRunner's main()
method is invoked, which sets up the CommandLine instance differently- namely, it calls the private processArgumentsAndReturnScriptName()
method, which is what processes the 'verbose' and 'stacktrace' command line arguments. This is not called from the executeCommand
method invoked by the launcher, which is why those two arguments are not being set properly. We could work around this by processing these arguments manually on the GrailsConsole instance, though the GrailsScriptLoader should also be fixed so this is unnecessary.
I have also created an issue on the Grails Jira for this problem.
This needs to be fixed in Grails for sure, but we can workaround this in Grails launcher for existing Grails version. See the workaround for interactive mode in DelegatingGrailsLaunchContext.
It's been almost a year with no activity. Is it difficult to add the work-around to grails-launcher?
Setting grails args using -Pargs="" or setting the args property explicitly in your GrailsTask configuration does not seem to carry over to the grails launcher. For instance:
gradle -Pargs="--verbose --stacktrace" grails-run-app
The preceding command fails when the app hits an OutOfMemoryError, yielding following log lines:
I would have expected the
--verbose
arg to have been passed through to the grails command, but it is not.