问题
Very similar to: Can't load gradle project in NetBeans but I think not exactly the same, if only because of the age of that question.
I saw gradle messages after firing up Netbeans 11, which is good. Looking to open gradle projects using the IDE.
Gradle looks to be installed:
but how do I open projects with gradle builds like:
NB 9 opens all these projects as gradle builds fine. I realize it sounds rather silly. I'll try some combinations.
Confirming that Gradle is present:
even creating a new project from scratch:
thufir@dur:~/NetBeansProjects$
thufir@dur:~/NetBeansProjects$ mkdir gradleInit
thufir@dur:~/NetBeansProjects$
thufir@dur:~/NetBeansProjects$ cd gradleInit/
thufir@dur:~/NetBeansProjects/gradleInit$
thufir@dur:~/NetBeansProjects/gradleInit$ gradle init --type java-application --test-framework testng --dsl kotlin
Starting a Gradle Daemon, 3 incompatible and 1 stopped Daemons could not be reused, use --status for details
Project name (default: gradleInit): gradleInit
Source package (default: gradleInit): gradleInit
BUILD SUCCESSFUL in 24s
2 actionable tasks: 2 executed
thufir@dur:~/NetBeansProjects/gradleInit$
thufir@dur:~/NetBeansProjects/gradleInit$ gradle clean run
> Task :run
Hello world.
BUILD SUCCESSFUL in 17s
3 actionable tasks: 2 executed, 1 up-to-date
thufir@dur:~/NetBeansProjects/gradleInit$
Yet Netbeans only will "drill into" the directory, it isn't seeing it as a gradle project:
odd that NB doesn't seem to recognize it as a project.
回答1:
The Gradle support is a new built-in feature for NetBeans 11. A few weeks ago a source patch was released.
You mentioned NetBeans 9, so I guess before you were using a separate plugin.
So either you try to apply the patch (even though the tickets were not looking like the bug you encounter was adressed) or maybe you could give the plugin another chance. Based on the user comments the plugin in version 2.0.2 works with NetBeans 11.
来源:https://stackoverflow.com/questions/56577513/can-only-load-some-gradle-projects-in-netbeans