Skip to content

Instantly share code, notes, and snippets.

@zedar
Created September 19, 2014 11:37
Show Gist options
  • Save zedar/c91d64fe8f5c49e92f21 to your computer and use it in GitHub Desktop.
Save zedar/c91d64fe8f5c49e92f21 to your computer and use it in GitHub Desktop.
ratpack installApp & JVM options

Setting JVM options for ratpack app distribution

Ratpack uses gradle to build fat-jar distributions. It contains gradle application plugin.

$ ./gradlew installApp

Above command whole distribution should be in build/install/ratpack-application-name folder.

$ ./gradlew distZip

Above command boundles the project as zip file.

Application could be started with script located in:

$ ./build/install/ratpack-application-name/bin/ratpack-application-name

In order to pass JVM options to generated starting script put following configuration into build.gradle file. Gradle from version 1.7 has added support for default JVM options.

installApp {
  applicationDefaultJvmArgs = [
    "-Dcom.sun.management.jmxremote",
    "-Dcom.sun.management.jmxremote.local.only=false",
    "-Dcom.sun.management.jmxremote.port=9999",
    "-Dcom.sun.management.jmxremote.rmi.port=9998",
    "-Dcom.sun.management.jmxremote.authenticate=false",
    "-Dcom.sun.management.jmxremote.ssl=false"
  ]
}

Then JVM options will become part of DEFAULT_JVM_OPTS attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment