redhat-developer / redhat-developer/vscode-java

maven extension support

Offen
#3,704 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

I'm experimenting with using this polyglot maven extension to convert my projects' pom.xml files into other languages (in particular pom.yaml or pom.kts). Maven seems to work just fine with it, but java language server doesn't seem to pick up either the maven extension or the non-xml pom file.

Is there some way to configure the language server to recognize the maven extension and/or the non-xml pom file, or is there a change that needs to be made to the vscode extension itself to pick things up?

Environment
  • Operating System: Mac 14.5
  • JDK version: 17
  • Visual Studio Code version: VSCodium 1.88.1
  • Java extension version: 1.32.0
Steps To Reproduce
  1. clone https://github.com/takari/polyglot-maven-examples and open that in vscode with the java language server
  2. add another dependency, e.g. guava collections compile("com.google.guava:guava:31.1-jre") to kotlin/pom.kts > dependencies
  3. open Main.kts, add a line for "import com.google.common.collect.Lists" and in the main function call "Lists.newArrayList(1, 2, 3)"
  4. Run "mvn install" to compile the project

Please attach logs

Current Result

because of the extension registered in the project's .mvn/extensions.xml, maven handles the alternative pom file just fine; however, vscode shows red underlines on the google import with an error about an unresolved reference; implying that the language server failed to recognize the added dependency on guava.

Expected Result

the language server recognizes the maven extension and uses it to parse and process the non-xml pom file. (completion support within the pom file a bonus)

Additional Informations

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere das Problem mit takari/polyglot-maven-examples und konzentriere dich dabei auf .mvn/extensions.xml, kotlin/pom.kts und Main.kts. Verfolge zunächst, wie der Java language server Maven-Projekte importiert und nicht-XML-POM-Dateien verarbeitet; abgeschlossen ist die Aufgabe, wenn die hinzugefügte Guava-Abhängigkeit in Main.kts aufgelöst wird und die alternative POM verarbeitet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
build-system, devtools, tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.