kelemen / netbeans-gradle-project

This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
173 stars 57 forks source link

Can't install 2.0.0.2 in Netbeans 9.0 (release) #395

Open jhalexand opened 5 years ago

jhalexand commented 5 years ago

I'm trying to install the nbm for 2.0.0.2 from the releases page in Netbeans 9.0 (release) but I get the following error:

Some plugins require plugin Groovy Support to be installed.
The plugin Groovy Support is requested in version >= 1.42 but only 1.41.1 was found.

The following plugin is affected:
    Gradle Support

I guess this isn't a shock since Groovy support isn't planned until the second donation, but it seems like maybe a slightly older version is actually available? I double checked and this did work in RC1 just fine.

tcfurrer commented 5 years ago

You can still download the groovy plugin in Netbeans 9 by temporarily changing the plugin portal URL to the 8.2 portal ( http://updates.netbeans.org/netbeans/updates/8.2/uc/final/distribution/catalog.xml.gz ), and then changing it back to the new Apache portal ( http://plugins.netbeans.org/nbpluginportal/updates/9.0/catalog.xml.gz ).

To change the plugin portal URL: go to Tools:Plugins:Settings, select "Plugin Portal", and hit the "Edit" button.

I'm guessing it probably only worked in RC1 just because the new Apache plugin portal didn't exist yet, so the default pointer was still pointing to the 8.2 portal there.

jhalexand commented 5 years ago

I had already added the 8.2 portal rather than changing the existing one. Would that make a difference?

tcfurrer commented 5 years ago

Oh, sorry your issue is more about the plugin version. I was able to get the older 1.4.3 release of the gradle plugin working on Netbeans 9 for now, and also haven't gotten the 2.0.0.2 release working yet.

LanguageAgnostic commented 5 years ago

Got it working by using this portal instead for the Groovy plugin: http://bits.netbeans.org/dev/nbms-and-javadoc/lastSuccessfulBuild/artifact/nbbuild/nbms/updates.xml.gz

I get the version 1.35 instead of 1.34.1

For other people reading this, here's the full instructions to make the version 2.0.0.2 (and 1.4.3) work with Netbeans 9 until the second donation. Made it a bit verbose for some people. 😄

Solution

Part 1:

You can now remove/reset the provider we added/modified and select them all again.

Part 2:

Note: You can also keep modifying the provider to download the version 1.4.3 from the 8.2 portal. Just making the guide easier to follow.

Part 3:

Alternative

If suddenly the 1st part doesn't work, here's an alternative (part 2 & 3 should still work).

I installed the plugin version 1.4.3 from Netbeans RC1 and I literally just copied/pasted the netbeans/groovy folder from Netbeans RC1's folder to the Netbeans 9's folder.

Making things faster for you people:

Note: Make sure the path doesn't end up groovy/groovy

Now continue with Part 2 & 3.

kelemen commented 5 years ago

I wonder if I should just remove the Groovy dependency then because it is not strictly necessary (it just improves Gradle file editing support but it is not that great anyway). It is in the manifest.mf: cnb.org.netbeans.modules.groovy.kit

geertjanw commented 5 years ago

Yes, removing the Groovy dependency would be a good idea. Also, it would be wonderful to have the Gradle support as a pull request at https://github.com/apache/incubator-netbeans and notice that we're planning a quarterly release schedule, maybe that could be good for the Gradle plugin process too to be aligned: https://cwiki.apache.org/confluence/display/NETBEANS/Apache+NetBeans+Release+Cycle

kelemen commented 5 years ago

It would be nice though I know practically nothing of NB's Ant build. So, I would need someone who does the tricky things in the Ant build (there are quite a few difficulty in the build).

Charlweed commented 5 years ago

I have a completely different solution to this issue: Compile a build of NetBeans, then compile the correct org-netbeans-modules-groovy-support.nbm from the source tree. It's not as much work as it sounds, and you don't have to hack anything. But hey, THIS COMMENT HAS THE 1.42 NBM AS AN ATTACHMENT if you don't want to build it yourself. I have built NB several times before, and this was one of the easiest builds. But if you don't know how to clone a repository, or install ant, or set a JRE (or JDK) just use the attached nbm.

  1. Follow the instructions on The Apache NetBeans page, and build NetBeans. It takes a while.
  2. CD to the "groovy.support" directory.
  3. Type "ant nbm-nosignature". This builds the nbm file into the subdirectory "build".

Of course you can use the development version of NB you just built, or import the 1.42 nmb into your release version.

org-netbeans-modules-groovy-support.zip

kjjaeger commented 5 years ago

Be very careful when you add this update site: http://bits.netbeans.org/dev/nbms-and-javadoc/lastSuccessfulBuild/artifact/nbbuild/nbms/updates.xml.gz My recommendation is to disable it right away after you get the plugin added. If you leave it enabled, NetBeans will try to update many other components, particularly some shared Java EE components. I went ahead and (foolishly) did the updates to the components not related to Gradle or Groovy. Then, some other plugins like Payara EE Common, Server, and Micro stopped working due to version issues.

I was able to get my environment back to normal using these steps:

  1. Uninstall all the Java EE related plugins.
  2. Remove the "enterprise" directory in the NetBeans program installation location.
  3. Then reinstall all the Java EE and Payara plugins.
aplatypus commented 5 years ago

I do not see a Gradle 2 plugin. The standard plugin repositories in netbeans are:

Can you please supply the Netbeans 9 plugin repository You are using (above)?

aplatypus commented 5 years ago

Personally I find the syntax support editing Gradle files to be very useful. Of course it would be a vast improvement to have Gradle syntax support. Tracking Gradle problems with a 1960-s --stacktrace approach is not really fun, at least the Groovy language support finds syntax mistakes, braces balancing, etc.

If you do remove the dependency there should be a notification on the plugin config to inform people that they Can have syntax checks by loading A Groovy support plugin.

kelemen commented 5 years ago

Removing the Groovy dependency would just mean that the plugin is installable without Groovy (in which case the Groovy related features would disapear) but if you have it, everything would work the same way.

cobexer commented 5 years ago

The plugin still can't be installed from the NB 9 update site, any plans on releasing an update that removes the Groovy dependency yet?

kelemen commented 5 years ago

I forgot about this. Can you build from the sources and check now? If everything is all right, I will have a release this weekend.

cobexer commented 5 years ago

I ran into a few problems with the build of this project (I'm using Java 11) so I tried to build with Java 8 but saw lots of warnings concerning unsupported annotation processors (which only support Java 6 or 7).

But I have run out of time for this weekend.

Maybe I can test this next week.

kelemen commented 5 years ago

The annotation processor warnings are irrelevant, you can safely ignore them.

cobexer commented 5 years ago

Compiling the Plug-In from cuurent master (7ac56077cb0a3cbc7fd7251593db33d53b07c387) still has the Groovy plugin as a hard dependency.

The Info/info.xml file lists it as both recommended and required.

cobexer commented 5 years ago

Also while you are at it: Could you update this project to use Gradle 5 for it's build? The used Gradle version doesn't run with Java 11 and that's a pain everywhere. Please note that Java 8 will be EOL end of January 2019 already!

kelemen commented 5 years ago

It seems this requires in multiple places. I have fixed that. Can you try now?

As for Gradle 5: I can't upgrade because the nbm plugin does not support it yet.

cobexer commented 5 years ago

The updated version still can't be installed because of a dependency to org.netbeans.modules.groovy.support > 1.42... org.netbeans.modules.groovy.support is part of NetBeans itself as far as I understand 1.42 isn't mentioned anywhere, however it seems that the plugin is built against a dev snapshot of NetBeans and thus requires newer versions than what is provided in NetBeans 9.0.

Which version of NetBeans is this plugin supposed to target and how is that done?

Also some parts of this build seem to target Java 6 still... Gradle 5: :( thanks for checking tough!

aplatypus commented 5 years ago

@cobexer ... I got a version of Groovy support from the NB v8.2 plugin repository.

I am hoping NB 10 will support Groovy officially. I am not holding my breath.

You need to add a plugin site in the Plugins dialogue manually. I found a few old friends there actually.

Good luck!!

cobexer commented 5 years ago

@aplatypus looking around I think that Groovy support made it into NB 10: https://github.com/apache/incubator-netbeans/pull/904 https://cwiki.apache.org/confluence/display/NETBEANS/Miscellaneous NB 10 also seems to be close to it's release - I can wait for that.

kelemen commented 5 years ago

I have realized that removing it from the plugin is a bigger issue than I have thought. It would require to factor out some small part of the code to a completely separate plugin which would make the installation worse (when Groovy is actually there). So, let's wait for NB 10 instead (I put back the requires on Groovy, since removing it was pointless).