You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to "reload dependencies" aka "The import ... cannot be resolved" after adding dependency to build.gradle #146
I confirmed that this is not an issue with the Eclipse JDT Language Server itself
What happened?
Hi, sorry if I misunderstood something, but this basic thing keeps happening to me and I don't know what's going on anymore and I couldn't find any relevant info online.
create gradle project (Spring Boot in my case)
add a dependency to build.gradle
lsp does not recognize the dependency, when add the import ... myself the lsp says The import ... cannot be resolved
this is the case for all dependencies
I tried:
restarting the LSP
./gradlew clean build --refresh-dependencies
rm -rf .classpath .project
and all possible combinations of the options above
the dependency is found correctly in other lsps (IntelliJ IDEA does not output any errors).
What did you expect to happen?
The LSP to recognize changed dependencies automatically or an obvious way to perform the "dependency sync", like there is in IntelliJ IDEA
Can you try adding this to your LSP settings? Remove whatever is specific to my use case, like formatter and java_home.
Let me know if jftls is then able to retrieve the required source files to resolve dependencies
maybe this should be explicitly mentioned in the extension readme, ik it's in the "Advanced Configuration", but at least in my case having a section about this would prevent the confusion
in my opinion it would be nice to have this enabled by default, but I can see arguments against doing this on the Zed side
Thanks for reporting back. We could implement a streamlined way of enabling such features while leaving out those really advanced. For example, as we did for Lombok, although the reason behind it was a little more complex, as we needed to download the Lombok jar to make it work properly.
Activity
tartarughina commentedon Dec 5, 2025
Can you try adding this to your LSP settings? Remove whatever is specific to my use case, like formatter and java_home.
Let me know if jftls is then able to retrieve the required source files to resolve dependencies
vfosnar commentedon Dec 5, 2025
thank you! it seems that the
importconfig does the trickmaybe this should be explicitly mentioned in the extension readme, ik it's in the "Advanced Configuration", but at least in my case having a section about this would prevent the confusion
in my opinion it would be nice to have this enabled by default, but I can see arguments against doing this on the Zed side
tartarughina commentedon Dec 5, 2025
Thanks for reporting back. We could implement a streamlined way of enabling such features while leaving out those really advanced. For example, as we did for Lombok, although the reason behind it was a little more complex, as we needed to download the Lombok jar to make it work properly.