redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 440 forks source link

The container 'Maven Dependencies' references non existing library #526

Open shankarramr opened 6 years ago

shankarramr commented 6 years ago

I have my .m2 repo folder in a different dive/location and I have updated the same in settings.xml. Maven from command line works fine outside of VSCode. But the extension seems to refer the old location somehow. I am not even sure how the previous location is 'known' to the extension.

Environment
Steps To Reproduce
  1. [step 1]
  2. [step 2]

[attach a sample project reproducing the error] [attach logs] [Error - 7:50:06 PM] May 2, 2018 7:50:01 PM Error occured while building workspace. Details: message: The container 'Maven Dependencies' references non existing library 'C:\Users\.m2\repository\junit\junit\4.8.2\junit-4.8.2.jar';code: 964 message: The project cannot be built until build path errors are resolved;code: 0

Current Result

The plugin is referring to the default location to pick up the jars

Expected Result

The plugin should be able to pick up the jars from the right location (moved location)

Additional Informations

I have tried giving the property java.configuration.maven.userSettings to the new location but still get the same error

fbricon commented 6 years ago

Can you try to run the "update project configuration" command?

shankarramr commented 6 years ago

Hi, thanks for the response. I tried it but it appears to be doing nothing and the issue still exist. The log did not reflect anything thro this command. Should I be looking somewhere else specific?

undyingtron commented 6 years ago

I am trying to replace NetBeans 8.2 as my primary Java IDE with VS Code (I am doing Vue.js frontends and SpringBoot backends these days) and was struggling with this issue yesterday. I also moved my default m2_repo location from the C: drive to a large portable drive and the Code extension refuses to use my user settings override. I did discover that the "update configuration command" fixes the issue but only for the current Code instance. When I restart Code I have to once again run "update project configuration" to get the IDE to recognize the jars that have been moved to my portable drive.

Language Support for Java by Red Hat Extension 0.28.0 (July 3rd, 2018)

MS Visual Studio Code Version: 1.25.1 Commit: 1dfc5e557209371715f655691b1235b6b26a06be Date: 2018-07-11T15:43:53.668Z Electron: 1.7.12 Chrome: 58.0.3029.110 Node.js: 7.9.0 V8: 5.8.283.38 Architecture: x64

fbricon commented 6 years ago

You can try cleaning up vscode's workspace directory

undyingtron commented 6 years ago

@fbricon Awesome, cleaning up the workspace did the trick! Thanks for the quick feedback. Just as an FYI, on my windows 10 box the directory I cleaned up was located here.

"C:\Users\your_username\AppData\Roaming\Code\User\workspaceStorage"