redhat-developer / redhat-developer/vscode-java

Java extension not downloading custom dependencies after editing userSettings

オープン
#2,842 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

classpath Maven
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
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
  1. I am not sure if the issue can be reproduced 100% because I am using a custom repo connecting to custom servers via VPN.
  2. The project was already opened on my other computer, where it was working correctly because it downloaded all the dependencies the first time.
  3. 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.
  4. 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.
  5. Not having maven in path variables and setting its path directly in VS Code might help replicating the issue.
  6. 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.
mvn package problem

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")
mvn success

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

java.configuration.maven.userSettings 設定と、update および package 用の Java extension の 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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。