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.
171 stars 57 forks source link

Issues when both Gradle and ant are available #433

Closed MeFisto94 closed 5 years ago

MeFisto94 commented 5 years ago

So due to legacy issues, our netbeans platform project suite is built with ant, which is invoked by gradle, this means that the Suite isn't reconized anymore as gradle takes priority. I don't know if it's possible to change that in any way, so that gradle is only picked up, if there is no nbproject folder?

The real issue however is this Exception which prevents me from Adding any Dependency to any Module of that Suite:

SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.apisupport.project.ui.customizer.AddModulePanel$6
java.lang.ClassCastException: class org.netbeans.modules.gradle.NbGradleProjectImpl cannot be cast to class org.netbeans.modules.apisupport.project.suite.SuiteProject (org.netbeans.modules.gradle.NbGradleProjectImpl is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @65149961; org.netbeans.modules.apisupport.project.suite.SuiteProject is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @3b2609f9)
    at org.netbeans.modules.apisupport.project.ui.customizer.SingleModuleProperties.getSuite(SingleModuleProperties.java:306)
    at org.netbeans.modules.apisupport.project.ui.customizer.SingleModuleProperties.getUniverseDependencies(SingleModuleProperties.java:628)
    at org.netbeans.modules.apisupport.project.ui.customizer.AddModulePanel$6.run(AddModulePanel.java:284)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

I don't know if this is easy to fix or not, but it's definitely related to the fact that the Gradle Project of the Suite is no Suite but a single project.

The workaround is easy: disable the plugin during that time.

Thanks in Advance for your time.

Edit: The workaround doesn't work, you need to fully uninstall the plugin, disabling still makes it recognized as gradle project, not sure why. Might be the "real" thing to look into for this issue.

kelemen commented 5 years ago

This registers with the lowest priority of all project types. However, you are not using this plugin (from the stacktrace), but a new one built into NB (which is completely independent of this project).

MeFisto94 commented 5 years ago

Oh then apologize the issue, I thought they more or less merged your plugin and that this codebase would still be relevant. Thanks for your time