3

Netbeans 8 used to support grails 3 well, but unfortunately did not work with multi-module projects. I tried intellij ultimate, but its grails support is just as poor.

I just downloaded the bin distribution of netbeans 11, and "enabled" it in privacy settings (They dont have a mac dmg or pkg installer unfortunately), but it doesnt seem to have any grails support whatso ever (no plugins available)

I just tried importing my grails 3.3.8 project, and it just says "broken". Won't even show me the source code.

Anyone had any luck with it?

skomisa
  • 16,436
  • 7
  • 61
  • 102
John Little
  • 10,707
  • 19
  • 86
  • 158
  • In my NetBeans 11 (on Windows) installation, it's part of the "Groovy" plugin. It is described as "*This module provides all Groovy and Grails functionality available in NetBeans. It is wrapper for all single modules in this area*" https://i.imgur.com/MT3hwr0.png –  Apr 05 '19 at 21:41
  • thanks horse with no name. So in theory, it should support grails, but does not appear to (cant import a grails 3.3.8 project, just says "broken"). my install on mac does say groovy plugin is active. – John Little Apr 05 '19 at 22:12
  • huh. I don't see groovy, grails, etc. I did enable groovy through `options > miscellaneous` – Thufir Jun 10 '19 at 06:50

1 Answers1

5

First, note that Grails 3.x will not work with JDK 11, so if your NetBeans 11.0 installation is using JDK 11, change the default platform to JDK 8 instead. You can do this by a suitable edit to etc/netbeans.conf. In my case, on a Windows 10 machine the change looks like this:

netbeans_jdkhome="C:\Java\jdk1.8.0_201"

(Of course you can still have JDK 11 as an additional Java platform.)

Next, as a comment to the OP noted, you need to install the Groovy plugin to use Grails with NetBeans 11. You will see that version 1.36.1 of the Groovy plugin is available for activation from Tools > Plugins > Installed:

availablePlugins

Unfortunately, after clicking Activate, the plugin does not allow configuration of Grails from the Tools > Options > Miscellaneous > Groovy tab, since the Grails Home field is missing:

NoGrailsHome

The fix for that is to uninstall (not just deactivate) the Groovy and Gradle plugins that came bundled with NetBeans 11, and revert to the plugin that was provided with NetBeans 8.2. This is documented in Bug Report NETBEANS-1976

Although the new "Gradle" and "Groovy and Gradle" plugins automatically disable themselves, this isn't good enough to avoid various conflicts with the old "Gradle Support" plugin. I had to uninstall the new "Gradle" and "Groovy and Gradle" plugins in order to get everything working with the old plugin on Netbeans 11.

The steps to follow to install the older version of the Groovy plugin are the same as those with NetBeans 9.0, as described in this answer to "Groovy and Grail plugin is missing in Netbeans IDE 9".

After doing all that you should be able to use the Project Wizard (File > New Project... > Groovy) to create a Grails Application in NetBeans 11:

GrailsProject

skomisa
  • 16,436
  • 7
  • 61
  • 102
  • I installed netbeans 11 a few days ago. Under "isntalled" are only 10 plugins, where as you have 92. In available plugins, is only 10, and under updtes, is only 1 (local tasks). In the installed plugin list, is groovy, but the activate tick is a greyed out circle. If I "select" it by checking the select box next to it, Activate and deactivate are greyed out, only Uninstall is an option. On the right it shows hte version of groovy as 1.0.1. THis it all out of the box. – John Little Apr 06 '19 at 13:36
  • I only have java 8 installed. – John Little Apr 06 '19 at 13:36
  • as per this post https://stackoverflow.com/questions/52826163/how-to-open-a-grails-3-3-app-in-netbeans-9 I have added 8.2 plugin portal, but this made no difference. – John Little Apr 06 '19 at 13:40
  • So you are saying that the new groovy plugin which comes with NB 11 is broken, and needs to be removed and the old 8.2 plugin needs to be installed. I know that plugin is flawed in that it has no support for multi-module project, which is why I was hoping the upgraded support in 11 would help. What a shame. – John Little Apr 06 '19 at 13:46
  • @JohnLittle OK. [1] I also only have 10 plugins installed on the **Installed** tab until I check the **Show_details** checkbox. Then I have 92. The numbers shown on the Installed and Available tabs also change based on the entries checked on the Settings tab. [2] You **must uninstall** the Groovy plugins that came with NB11 based on the Bug Report comment I linked to. [3] The bug report comment is saying the plugin is broken, not me. [4] I am using Windows 10. What is your O/S? [5] I only installed NB11 after seeing your post, but the above approach works for me. I will reinstall to verify. – skomisa Apr 06 '19 at 16:13
  • FYI, also see [Detect conflicts with Netbeans 11 built-in Gradle plugins to generate some helpful error to the user #429](https://github.com/kelemen/netbeans-gradle-project/issues/429) – skomisa Apr 06 '19 at 16:16
  • IC. so the new plugin and old plugin dont work together, and you have to remove the new plugin. Shame, as I was hoping the new plugin would add support for mulit-module projects. – John Little Apr 06 '19 at 16:25
  • Yes, based on that bug report comment you must remove the new plugin (and I verified that claim). I suspect the best you can hope for with Grails with NB11 is to have it working as it did with NB 8. Once Grails 4 is released you should also be able to use JDK 11 in NB11 for Grails development, but that's a separate matter. – skomisa Apr 06 '19 at 16:41
  • @JohnLittle I haven't tried it yet, but I see that [Grails 4.0.0 RC1](https://github.com/grails/grails-core/releases/tag/v4.0.0.RC1) was released on April 17. If you feel brave you could try using it with NB 11 and its bundled Groovy and Grails plugins when running JDK 11 or JDK 12. Obviously you need a separate installation of NB 11 for this if you are currently using NB 11 with Grails 3.x since Grails 3 and Grails 4 apparently use different plugins for Groovy and Gradle. – skomisa May 10 '19 at 02:52