1

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:

creating project

but how do I open projects with gradle builds like:

opening project

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:

gradle plugin installed

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:

dummy project

odd that NB doesn't seem to recognize it as a project.

Thufir
  • 8,216
  • 28
  • 125
  • 273
  • [1] What do you see for **Product Version** if you do **Help > About**? I get *Product Version: Apache NetBeans IDE 11.0 (Build incubator-netbeans-release-404-on-20190319)* on my Windows 10 machine. [2] The plugin versions for Groovy and Gradle that come boxed with NB11 are different to those for NB 9. Perhaps there is an incompatibility/bug when opening Gradle projects created using the older plugins? You could test this by deleting the newer plugins on NB11, then installing the older ones used on NB9. Does that allow you to open your NB9 Gradle projects on NB11? – skomisa Jun 13 '19 at 19:58
  • Another thing you could try is [download the latest daily build](https://builds.apache.org/job/netbeans-linux/). That release of NB 11 might contain a fix for your problem. (Just a guess - I have no evidence that it does.) – skomisa Jun 13 '19 at 20:02

1 Answers1

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.

Joachim Rohde
  • 5,915
  • 2
  • 29
  • 46