redhat-developer / redhat-developer/vscode-java

imports are not resolved in maven multi module project

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

还没有人认领这个 Issue。

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

描述

Hi,

I use vcode for a multi module project cumulocity-dynamic-mqtt-mapper, (branch develop).

The project structure is as follows:
|----mqtt-mapping-service
|  |----pom.xml
|----mqtt-mapping-interface
|  |----pom.xml
|----mqtt-mapping-extension
|  |----pom.xml
|----pom.xml

When ...

  1. I open the project in vcode (extension pack vscjava.vscode-java-pack) and
  2. navigate to the module mqtt-mapping-extension and
  3. open class mqtt-mapping extension/src/main/java/mqtt/mapping/processor/extension/external/ProcessorExtensionCustomEvent.java
  4. I see the following errors:
    The import mqtt.mapping.model cannot be resolvedJava(268435846) mqtt.mapping
    in the source editor:
Screenshot 2023-07-13 at 23 03 24
Environment
  • Operating System: MacOS
  • JDK version: OpenJDK 64-Bit Server VM Zulu11.60+19-CA (build 11.0.17+8-LTS, mixed mode)- Visual Studio Code version:
  • Java extension version: v0.25.12
Steps To Reproduce
  1. clone the project (https://github.com/SoftwareAG/cumulocity-dynamic-mqtt-mapper/tree/develop)
  2. navigate to the module mqtt-mapping-extensionand open class mqtt-mapping-extension/src/main/java/mqtt/mapping/processor/extension/external/ProcessorExtensionCustomEvent.java
Expected Result

When I open the same project in IntelliJ I don't get any errors. In can use classes from the module mqtt-mapping-interface in the module mqtt-mapping-extension.

Regards Christof

贡献指南

打开贡献指南

从这里开始

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

调研方向

在其 develop 分支上克隆链接的 cumulocity-dynamic-mqtt-mapper 项目,并在 VS Code 中打开 mqtt-mapping-extension/src/main/java/mqtt/mapping/processor/extension/external/ProcessorExtensionCustomEvent.java。以根目录和模块中的 pom.xml 文件为起点,检查 Maven 多模块项目是如何导入的。当扩展模块中来自 mqtt-mapping-interface 的导入在没有 Java 诊断的情况下解析成功时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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