How can I disable IntelliJ using the Gradle run task to run my code?

随声附和 提交于 2021-02-06 15:13:19

问题


After updating IDEA, every time I debug a class in a new project only, it seems to be using the Gradle run task to run my code (despite using an "Application" run configuration, not "Gradle"!):

6:40:27 AM: Executing task 'Test.main()'...

Connected to the target VM, address: '127.0.0.1:49580', transport: 'socket'
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
Connected to the VM started by ':Test.main()' (localhost:49597). Open the debugger session tab

> Task :Test.main()
test

This is causing me many problems.

If I run tasks in an old project, it will just compile and run the code directly, without using Gradle. I compared all the settings in the two run configurations, and they're identical.

How can I disable this and prevent IntelliJ from creating this kind of run configuration when I just want a regular run configuration?


回答1:


In IntelliJ-IDEA 2019 the option was moved directly to Gradle Settings (Build, Execution, Deployment -> Build Tools -> Gradle):

Run tests using: Gradle / IntelliJ IDEA



来源:https://stackoverflow.com/questions/56513939/how-can-i-disable-intellij-using-the-gradle-run-task-to-run-my-code

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