Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails: Pass options to the forked JVM

I'm using Grails 2.3.5 and I need to pass an option to the forked JVM. I've tried doing this by setting the JAVA_OPTS environment variable, but that simply gets ignored by the forked JVM. How can I go about passing the forked JVM an option?

I've found this: http://jira.grails.org/browse/MAVEN-177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel but that's if you're using the Maven plugin I believe. I'm looking for the equivalent but without having to get Maven plugin involved.

like image 592
Harry Muscle Avatar asked Jan 30 '14 20:01

Harry Muscle


1 Answers

According to: http://grails.org/doc/2.3.x/guide/commandLine.html#forkedMode (near the bottom of the section) you can use jvmArgs in your grails.project.fork configuration. In BuildConfig:

grails.project.fork = [
    // ...
    run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256, jvmArgs: '..arbitrary JVM arguments..']
    // ...
]
like image 107
Andrew Avatar answered Sep 18 '22 18:09

Andrew