سؤال

Say I wanted to run a Grails (2.3+) app with an extra "-Djava.fizz.buzz=3" JVM arg.

Is it as simple as:

grails run-app -Djava.fizz.buzz=3

Or is there special config (say, in BuildConfig.groovy) that would need to take place?

هل كانت مفيدة؟

المحلول 2

The answer to your question is yes, that will work. JVM args work a bit differently. Both are in the docs about the command line.

نصائح أخرى

That should work. And to have access to the arg you just created, you may call System.properties[] anywhere in your code:

if (System.properties['java.fizz.buzz'] == '3') {
    ...
}
grails -Djava.fizz.buzz=3 run-app
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top