grails 3 system properties pain

14 views
Skip to first unread message

Rick LaBanca

unread,
Nov 23, 2018, 6:31:20 PM11/23/18
to Grails Dev Discuss
Giving a try at migrating an app to 3.. finally.  So I am trying to settle the small things.
I normally have a ton of -D options for setting things in the JVM and a few for grails such as the port.

When doing run-app those don't get passed. So I saw the idea of copying them all in the bootRun section.

That works, but then the issue is if I set up a debugger or jmx port, it gets set on the main vm and also the spawned one, and of course fails.

In production all the settings will be fine of course, it's this vm spawning that is the issue. Is there a way to just run tomcat without spawning?

If not has anyone come up with a handy way of managing the system props that would be common, and also unique to the main vm and spawned vm?




Katy

unread,
Nov 25, 2018, 4:27:50 PM11/25/18
to Grails Dev Discuss
In order for your application to read the -D options that you pass, you need to add the following to your build.gradle:

tasks.withType(JavaExec) {
    // Assign all Java system properties from the command line to the JavaExec task.
    systemProperties System.properties
}

It should work then...
Reply all
Reply to author
Forward
0 new messages