redhat-developer / redhat-developer/vscode-java

Maven importer should support custom POM filenames or honor maven.pomfile.globPattern

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

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

enhancement
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

Problem

A Maven Java project uses pom-customize.xml instead of pom.xml.

Maven itself works:

mvn -f pom-customize.xml compile

The VS Code Maven extension can be configured to discover it:

{
  "maven.pomfile.globPattern": "**/{pom.xml,pom-customize.xml}"
}

But the Java language server does not import the Maven classpath from pom-customize.xml. Java files then show false diagnostics such as:

RestController cannot be resolved to a type

Example import:

import org.springframework.web.bind.annotation.RestController;

## Expected behavior

The Java language server should either:

1. Honor maven.pomfile.globPattern, or
2. Provide a Java setting such as java.import.maven.pomfile.globPattern, or
3. Support custom Maven POM file names when Maven for Java has already discovered them.

## Actual behavior

Maven Explorer can discover the custom POM, but JDT LS / Red Hat Java does not import the project classpath unless the build file is named pom.xml.

## Environment

- VS Code
- Extension: redhat.java version 1.55.0
- Extension: vscjava.vscode-maven version 0.45.3
- Java: 21
- Maven project file: pom-customize.xml
- No pom.xml in project root

## Workarounds tried

- maven.pomfile.globPattern
- maven.executable.options: -f pom-customize.xml
- .mvn/maven.config with -f pom-customize.xml

These help Maven commands/explorer, but do not fix Java language server diagnostics.

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

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

はじめの一歩

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

調査の方向性

pom-customize.xml のみを使って VS Code でプロジェクトを再現し、Maven Explorer の検出と JDT LS / Red Hat Java のクラスパスインポートを比較します。Java 言語サーバーの Maven importer と maven.pomfile.globPattern の動作から調査を始めます。カスタム POM がインポートされ、RestController の診断が消えることを完了条件とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, vscode
領域
build-system, developer-experience, devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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