redhat-developer / redhat-developer/vscode-java

Maven project inside another maven project not recognized

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

还没有人认领这个 Issue。

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

描述

When you have a maven project inside another maven project, only the top level project is properly recognized in the java projects view. However, if the sub-project is opened in another window by itself, the project is properly recognized

Environment
  • Operating System: Fedora 38
  • JDK version: openjdk 17.0.7
  • Visual Studio Code version: 1.81.0
  • Java extension version: 1.21.0
Steps To Reproduce
  1. Create new maven project (using maven for java extension)
  2. Create new maven project inside project from step 1. Example structure below:
test_project/
    src/
        main/
             java/
                TestMain.java
    pom.xml
    sub_project/
        src/
            main/
                java/
                    SubMain.java
        pom.xml
  1. Import Java Projects into Workspace
  2. Observe only test_project is properly imported in this case
  3. Open a new window: File > New Window
  4. Inside new window, open sub_project: File > Open Folder > select sub_project
  5. Observe sub_project can now be recognized as a java project
Current Result

Only top level projects are recognized, projects inside projects are not. This leads to the warning SubMain.java is not on the classpath of project test_project, only syntax errors are reported and many features of the extension not working

Expected Result

Projects are recursively detected by their pom files and the extension features can be used for projects inside projects

贡献指南

打开贡献指南

从这里开始

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

调研方向

使用 issue 中描述的嵌套 pom.xml 文件重现 workspace,然后将 Import Java Projects 与仅打开 sub_project 进行比较。首先跟踪项目导入入口,以及 extension 如何发现 pom.xml 文件。当嵌套项目能够递归识别,并且 SubMain.java 不再报告自己位于 classpath 之外时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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