redhat-developer / redhat-developer/vscode-java

maven extension support

未关闭
#3,704 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 takari/polyglot-maven-examples 重现该问题,重点关注 .mvn/extensions.xml、kotlin/pom.kts 和 Main.kts。首先跟踪 Java language server 如何导入 Maven 项目以及如何处理非 XML POM 文件;当添加的 Guava 依赖项能够在 Main.kts 中解析,并且替代 POM 得到处理时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
build-system, devtools, tooling
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。