-
Notifications
You must be signed in to change notification settings - Fork 456
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
Add the java.configuration.maven.globalSettings property #1365
Add the java.configuration.maven.globalSettings property #1365
Comments
@alantango How did you create your SSL certificate on https://internal.myfirm.com/repository/maven/? |
@snjeza Thanks. I don't know how it was generated but it's an enterprise internal cert (the name I used above is masked for obvious reasons). You think it has something to do with the cert? |
Does the issue happen in Eclipse? |
@snjeza It works fine with Eclipse, no proxy used in Eclipse, the repo server is within the corp network. Eclipse's Maven setting points to the exact same setttings.xml files as installed on my machine. |
@alantango Could you send your VS Code settings.json and Maven settings.xml path? |
@snjeza Here: Here is the entire settings.json:
|
@alantango could you try to add the following VS Code settings:
or
|
@snjeza Tried both and problem remains the same. Btw I also tried a popular suggestion of command "Java: clean the Java Language server workspace" -> Restart and clean, with or without above changes, no effect. |
Could you show the next Eclipse Preferences: |
@alantango which version of Eclipse are you using? |
Could you show the General>Network Connections Eclipse Preferences? |
VS Code doesn't use global maven settings. |
@snjeza Oh that's interesting...didn't know that. Anyways just tried, problem remains. I made sure mvn command standalone still works. |
@alantango could you try the following in Eclipse:
Could you also check Eclipse IDE 2020‑03? |
@snjeza Current Eclipse works with merged global setting files. But vscode still won't work. Don't plan to change to Eclipse 2020-03. |
@alantango Could you send your VS Code log when using merged global settings in VS Code? |
|
@alantango could you send the output of the following command:
You have three 't' in settings.xml |
@snjeza Ahh that was it. I corrected and file name and it worked, then I removed the setting altogether and it worked as well. Looking at the thread history, that wrong file name 'setttings.xml' was added BEFORE I merged the global settings file. It can either be empty or put in with a correct file name. Thank you very much! So the key is what you said earlier: VS Code doesn't use global maven settings. I would strongly suggest making that statement prominently clear on the README of this extension. I believe this is also the solution to #1232. |
@fbricon should we add the java.configuration.maven.globalSettings property? |
@snjeza , one more voice here, but:
yes. A colleague and I spent about 3 hours digging around in all the wrong places to finally discover this comment chain. It would be best to support globalSettings as its a very highly used maven idiom. But if you dont, it would be nice to put that somewhere in the documentation. |
Yeah this bit me real bad! Please make a |
I'm very close to make the switch to VSCode from Eclipse, this is the last hurdle, but one I can't walk around. Please help.
The Problem: A working Maven project that builds fine with command line mvn will have many errors in pom once loaded in VS code. POM errors result in classes / types in dependency libraries not resolved in the editor.
Note: This seems to happen only within a corporate network using our own internal central repo server (like "https://internal.myfirm.com/repository/maven/"). Same code works at home, though I don't use any customized maven setting files like those at work.
Screenshot of the project error here:
My guess is as a result of the error, no .classpath file is generated, and no dependencies are shown on the project tree on the left panel.
What I don't understand is why would VSCode complain about connecting to the public Maven central repo while my maven settings point to our own repo server?
If I replace both settings.xml with standard plain setting files, it pulls dependencies from the public maven central https://repo.maven.apache.org/maven2 and works just fine. Obviously I cannot do that in practice as I'm required to use corporate maven repo.
Note:
M2=C:\dev\maven\3.3.9\bin
M2_HOME=C:\dev\maven\3.3.9
Environment
OS: Windows10 build 1809, 64-bit
VSCode Version: 1.43.2
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
Reference Files
See attached project
mytest.zip
Maven setting files attached (masked)
settings(global).txt
settings(user).txt
JDT log file:
mytest.jdt.log
The text was updated successfully, but these errors were encountered: