Hi I am trying to run gradle with different JVM se...
# community-support
n
Hi I am trying to run gradle with different JVM settings. We have a multi-project setup. We have various CI tasks that are run through gradle. When we do our full build it requires a lot of JVM memory. However there are some other gradle tasks that we run in a separate Github Action and we would like to give that JVM less memory. Right now this is all defined in
gradle.properties
. Looking at the documentation I thought I could do it by saying
--no-gradle-daemon
and using the
JAVA_OPTS
environment variable but the build still uses the settings defined in
gradle.properties
. Is there a way to run gradle with different JVM settings depending on which gradle task we want to run…
v
--no-gradle-daemon
would not even run. 😄 But given you mean
--no-daemon
, the option name is a bit misleading. It actually means "use no daemon if the CLI process fulfills the requirements for the daemon, otherwise run a one-shot daemon that is terminated after the build run". So instead of
--no-daemon
you probably need to use
-Dorg.gradle.jvmargs=...
to override what you have in
gradle.properties
.
n
of course!
thanks
P.S. Probably the documentation should be updated with a 3rd option here.
v
Which one?
n
v
I asked which 3rd option you want added
With the
-D...
you are setting the Gradle property mentioned in Option 1
n
i.e. pass in
-Dorg.gradle.jvmargs=...
at the command line
v
As I said, that is Option 1
Besides that those are not really options, but just different memory settings you can change, with almost no relation to each other, so they are not really either-or options