How to disable Gradle daemon in IntelliJ Idea?

我与影子孤独终老i 提交于 2019-12-29 04:29:28

问题


I need to disable the Gradle daemon in IntelliJ Idea, because somehow Scala plugin is not working with the daemon (the compilation fails with NullPointerException). I have tried to edit my IntelliJ Gradle build configurations to include a JVM system parameter -Dorg.gradle.daemon=false:

Also I've tried to use --no-daemon flag at the same place (Script parameters and VM options). Also I've tried to specify these options in the Preferences -> Gradle menu of IntelliJ. None of these attempts gave any result, the daemon continue to start, so I have to kill it before running/compiling for the second time.

Neither disabling daemon explicit in ~/.gradle/gradle.properties according to https://docs.gradle.org/current/userguide/gradle_daemon.html#N10473 doesn't have any effect.

How can I disable the Gradle daemon usage in IntelliJ Idea?


回答1:


IntelliJ interacts with Gradle via the Gradle tooling API, which always uses the daemon. i.e. There is no way to turn it off.

What you could do (after filing a bug report) is not to use the IntelliJ Gradle integration but instead generate IntelliJ project files with

gradle idea




回答2:


Because of lack of support of old libraries I moved a project from gradle to maven build management tool. But Intellij always wanted me to trigger a gradle changes import: additionally to "Maven project needs to be updated", there was also a "Gradle project needs to be updated" when I did changes to i.e. dependencies in pom.xml, with no integration of gradle in the project source files at all, no wrapper etc.

In my case I was able to get rid of Intellij bothering me with gradle by deleting the line <property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.gradle" /> in .idea/workspace.xml and deleting the file .idea/gradle.xml in Intellij IDEA Ultimate 2019.2.



来源:https://stackoverflow.com/questions/25422163/how-to-disable-gradle-daemon-in-intellij-idea

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!