0

I am using the Java plugin for gradle. How do I pass in some vm arguments to the >gradle test command?

The arguments can be in the build.gradle as I always want them passed in.

Thanks

More Than Five
  • 9,959
  • 21
  • 77
  • 127

2 Answers2

1

Specify the jvmArgs argument for the test task.

test {
    jvmArgs '-XX:MaxPermSize=256m'
}

Official documentation

Florian Gutmann
  • 2,666
  • 2
  • 20
  • 28
1

From the Gradle documentation:

jvmArgs The extra arguments to use to launch the JVM for the process. Does not include system properties and the minimum/maximum heap size.

apply plugin: 'java' // adds 'test' task

test {

  // set JVM arguments for the test JVM(s)
  jvmArgs '-XX:MaxPermSize=256m'

}
Beholder
  • 36
  • 3