-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve class for qualified imports #229
Comments
You need to specify the directory to where you have Gradle downloaded in the global settings and then the plugin should use the jars in its "lib" folder. |
This issue is also applicable to "Single Gradle Projects" |
I have just checked the sources and it seems you are right. For some reason I just include the jar files starting with "gradle-". I will update this. |
I have pushed some changes which should fix this in theory but to me currently it doesn't. However, due to some other circumstances I believe that I'm hitting a bug in the Groovy plugin, so it might work for you. Can you try building the plugin from the sources and see if it works for you? |
Thanks! I'd love to, but the weekend keeps me away from my keyboard. I'll give it a try on Monday. |
Why are you excluding |
I'm excluding it because the Groovy plugin uses the groovy-all jar defined in the library manager (or at least, this is what it says). So, I do not want to conflict with the Groovy plugin. To be honest I don't really know what the Groovy plugin does, I simply removed it because that was written in the Groovy global settings dialog. Though, I can add it if you think that including "groovy-all" is what solves the problem. But first can you try if configuring the Groovy plugin properly works as intended or do I need to apply the change? |
By the way, I have desperately tried to create a test case for this issue mimicking https://github.com/kelemen/netbeans-gradle-project/blob/master/netbeans-gradle-default-models/src/test/java/org/netbeans/gradle/model/java/Issue101Test.java, but I'm failing miserably with
I'm giving up for the moment, but if it helps, this build.gradle could be used as test data. |
In any case, these issues doesn't impede the use of the plugin, so feel free to mark this (and #231) as enhancements. |
I'm not sure what test case did you try doing but I'm not sure it is reasonably possible to test from this plugin. In any case probably the solution is not to exlude the groovy-all. Maybe the Groovy config is meant only for some kind of Groovy projects (say for the Ant project type). |
For the time being, I have patched it locally so I don't get distracted with the red flags. I'll report if I have any kind of undesired side-effects, but I doubt that with my use of the plugin I come in conflict with any other groovy installations. Regarding the tests, the above mentioned |
Yes, but that only checks if I can request the compile/runtime dependencies from Gradle. I do no such thing for Gradle files (I'm not even sure if it is possible). That is, I just assume that the dependencies are the jars of the lib dir. |
It does read groovy-*.jar and it recurses into gradle/lib/plugins to resolve buildscript dependencies.
I have the latest Gradle plugin for Netbeans, but I am seeing these warnings in Netbeans (as discussed here). How can I fix this issue? |
@munichman2008 What exactly do you see? For you other problem, please open another issue with exact error messages and a detailed description. |
Within the build.gradle file, Netbeans shows these lines cannot be resolved: I have the latest Netbeans and latest version of this plugin. |
I probably should list those .jar files in the plugin folder, I just never checked the implications of adding them (if it has some adverse effect). Regardless, you will have much more issues with the Groovy editor but I have seen that Sven is working on NB's Groovy support and it looked promising. I personally rarely write complicated logic into .gradle files but instead use |
What is buildSrc? |
For every Gradle project (multi project build) you can have a Groovy project named buildSrc in the root project's directory. That project (buildSrc) will practically become the dependency of all your Gradle scripts , so you can use anything from that project (you may even define your own plugins to apply in build scripts). As an example, you can look at the buildSrc of this project: https://github.com/kelemen/netbeans-gradle-project/tree/master/buildSrc |
Not sure if this is the same root cause, but with NetBeans 9 (beta1) the editor flags the line:
as invalid as well, even though the build script works fine from within NetBeans and from the command line. t's not a real problem, just a bit annoying. This is with version 2.0.0.2 of the plugin. Here is a screenshot: |
I have seen and checked this problem many-many times and I strongly believe that this is a non-deterministic issue of the Groovy integration, so I can't really do anything about it. |
NetBeans reports an 'unable to resolve class ...' if using a qualified import. See screenshot below.
The error can be safely ignored.
Using:
To reproduce:
The text was updated successfully, but these errors were encountered: