-Duser.timezone=UTC ignored when running Grails app

Answered

I have a Grails application that expects to run in UTC time.

When I run from the JAR at the command line, I pass -Duser.timezone=UTC as an argument to Java, and all works as expected.

When running or debugging in IntelliJ Ultimate, the timezone always reverts back to my local time zone no matter what I do. I have tried entering -Duser.timezone=UTC as a VM option in the Run/Debug configuration, but that doesn't work. I also added the value directly to the command line field of the same dialog, but that doesn't work either.

When using the community edition of IntelliJ, the timezone works as expected.

What do I need to do the set the user.timezone value in IntelliJ Ultimate so that the Grails app will use UTC time?

0
3 comments
Avatar
Permanently deleted user

Setting jvmArgs in build.gradle worked. And, it worked even though I'm starting the Grails server in my configuration and not using Gradle directly.

The weird part to me is that setting user.timezone as mentioned in the original post works in the IntelliJ community edition. Should it work in Ultimate?

0

If you are using the same run/debug configuration and the same command line is printed in CE, then it should work the same as in UE.

Note that CE has no support for Grails, so you are probably using some other run/debug configuration.

0

Please sign in to leave a comment.