Description
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"
)