When running a gradle build in TeamCity I'm getting the following error when compiling test sources:
FAILURE: Build failed with an exception. *
What went wrong:
Execution failed for task ':compileTestGroovy'. > Java heap space *
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I've tried bumping up the available heap space by adding "-Xmx2g" the "JVM command line parameters" setting, but the error still occurs. What is the correct way to increase heap space for a build? Also, it's worth noting that the build completes without error if I run the equivalent gradle commands from the command prompt on the server running the build agent.