redhat-developer / redhat-developer/vscode-java
Java extension not downloading custom dependencies after editing userSettings
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 547
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
I could not tell you why, but all this worked as intended one month ago on my desktop.
I just could not get the setting "java.configuration.maven.userSettings": "./customSettings.xml" to work under neither Workspace nor User in VS Code. I have also used the full path (eg. D:\SpringBoot and Angular\Workspace\apache-maven-3.8.6\conf\customSettings.xml).
The only way I could get it to download the custom repos was by using terminal and manually running & "path\maven.bat" -s "path\customSettings.xml" dependency:list. I had already tried using global settings as well, always cleaning the project under the MAVEN menu > Lifecycle>clean and rebuilding the whole java project with clean language server workspace every time I edited my settings.
By the look of it the update was trying to fetch the custom dependency from maven central even though the customSettings.xml was specified under settings.
I have also tried deleting all dependencies, forcing rebuild of the project with the empty pom file and then putting them back on, but alas to no avail...
I might be missing something but having it done on my desktop I am pretty sure the only thing one has to do is edit that user setting...
Same with the package feature, manually executing: & "path\maven.bat" clean package -DskipTests -f "path\pom.xml" -s "path\customSettings.xml" works as intended, getting maven's path just as running "clean" does, then getting the right customSettings.xml and applying the command to the pom file.
Environment
- Operating System: Windows 11
- JDK version: 11
- Visual Studio Code version: 1.74.1
- Java extension version: 1.13.0
Steps To Reproduce
- I am not sure if the issue can be reproduced 100% because I am using a custom repo connecting to custom servers via VPN.
- The project was already opened on my other computer, where it was working correctly because it downloaded all the dependencies the first time.
- Opening my project on a different pc started this problem. I had already tried maven clean command, Java: Clean Language Server Workspace and rebuilding the project.
- Having a project that connects to a custom dependency repo which is on another machine, opening it once on a pc (downloading all dependencies) and then reopening it on another might reproduce this problem.
- Not having maven in path variables and setting its path directly in VS Code might help replicating the issue.
- Both updating the project and clean package by using the maven commands supplied by the extension do not reference the customSettings.xml and tries to download custom dependencies from maven's own repo.
The issue presents itself also when building package. Clean package is not possible and skip tests needs to also be done manually.
I have updated the post to include the new screenshots I could replicate by packaging the project.
Current Result
Maven not downloading the dependencies by referencing the correct customSettings.xml file.

Expected Result
Being able to update and build the project without having to resort to using the terminal. (made by using & "path\maven.bat" clean package -DskipTests -f "path\pom.xml" -s "path\customSettings.xml")

贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 java.configuration.maven.userSettings 设置以及 Java extension 的用于 update 和 package 的 Maven 菜单命令开始。如果可能,请在 Windows、JDK 11、VS Code 1.74.1 和 Java extension 1.13.0 环境中复现,并将这些命令与文档中记录的终端 Maven 命令进行比较。当 customSettings.xml 能够在无需终端干预的情况下传递给依赖项更新和 package 构建时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, typescript, vscode
- 领域
- build-system, devtools
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100