-
Notifications
You must be signed in to change notification settings - Fork 441
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
Dependencies incorrectly marked as unresolved in build.gradle file #2126
Comments
The Java extension finds a gradle distribution in the following order:
Since you want to use local gradle, you should leave "java.import.gradle.version" empty and configure your gradle home with |
Thank you for the tips! Here are my settings now:
However, I'm still getting the unresolved dependency issue in the build.gradle file and it looks like the plugin is still trying to download an external gradle version:
Is this just a check to see what gradle versions are available? I feel like if I have a local gradle version installed that I know I want to use that version so it shouldn't need to check using the network. |
I've also added the following line to my settings file:
I have the environmental variable GRADLE_USER_HOME set properly, so I don't think this does anything but I wanted to see if it could account for why it can't find the dependencies in that directory under /caches |
@brendansailer you may want to take a look at #1495 and #901 |
@snjeza Hmmm I just tried those settings without luck. I have |
@brendansailer Could you try to create ~/.cache/tooling/gradle/versions.json
|
@snjeza Ah thank you for the tip - it fixed that error in the logs (once I moved the versions.json file to the cache directory)! My apologies for being new to OSS - I've learned a lot from opening a handful of issues across various vscode gradle extensions. I definitely will use the search bar before opening any more issues. Up next is contributing for me :) Now I'm getting no errors in the logs, yay! However, the dependencies are still being marked as unresolved despite the fact that I can run gradle commands from the command line (meaning the dependencies can be resolved). See below: This problem can be annoying because I can't tell if dependencies are actually unresolved. I believe I have all the settings configured properly (see comments above), but please let me know if you want me to try anything. |
@brendansailer Could you check if there is ~/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/5.0.8.RELEASE/*/spring-expression-5.0.8.RELEASE.jar and show your .classpath file? |
@snjeza Yes, I have a Here's my .classpath file (snippet):
Please let me know if you need anything further! Several other of my teammates who also work in this network-constrained VM environment also have the same problem, so I really appreciate your help. Lmk if you need more of the .classpath file. |
@brendansailer could show your build.gradle, gradle.propertie and .settings/org.eclipse.buildship.core.prefs? |
@snjeza Sure! My build.gradle (removed some dependencies/extraneous stuff since it got long):
My gradle.properties (removed some for simplicity):
My .settings/org.buildship.core.prefs:
It looks like I messed up the spacing a little editing it here. Also, I removed some things that aren't important. Thanks for the help! |
@brendansailer Could you try to set the following VS Code property:
and remove the following:
|
@snjeza I removed that last bit in my build.gradle and already had When I reload vscode, all my imports in my Java classes are unresolved and I have the same error as before in my build.gradle. I ran "gradle eclipse" which resolved the dependencies in my Java files, but I still have unresolved dependencies in the build.gradle file. The problem is that they're actually resolvable since I can run gradle commands without error, but vscode thinks they're unresolved. |
I can't reproduce the issue.
|
@brendansailer could you check .settings/org.eclipse.buildship.core.prefs
|
@snjeza I'll get back to you after I do more investigation! I also tried changing orffline.mode=true without luck. I appreciate the help - I'll ping you once I dig deeper into the problem! |
This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further. |
Hello - I'm getting unresolved dependency "problems" in the problem viewer next to the terminal at the bottom of vscode. There's nothing wrong with the build.gradle file as I can successfully run gradle tasks using the terminal. I have over 20 of these problems (both with external and internal dependencies) and they look like this:
Unresolved dependency: org.springframework:spring-expression:5.0.8.RELEASE
I'm confused by the errors in the logs I'm getting because I have settings which should use my local Gradle version (rather than downloading one):
My company machine has fairly strict traffic rules, so I think some of the requests are getting blocked, so I thought that using a local gradle version would work. Thank you for the help!
Environment
Steps To Reproduce
The build.gradle file (the versions come from gradle.properties):
Logs:
Current Result
20+ of these "problems": Unresolved dependency: org.springframework:spring-expression:5.0.8.RELEASE
Expected Result
No errors
The text was updated successfully, but these errors were encountered: