redhat-developer / redhat-developer/vscode-java

imports are not resolved in maven multi module project

Open
#3,201 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

upstream
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Clone the linked cumulocity-dynamic-mqtt-mapper project on its develop branch and open mqtt-mapping-extension/src/main/java/mqtt/mapping/processor/extension/external/ProcessorExtensionCustomEvent.java in VS Code. Inspect how the Maven multi-module project is imported, using the root and module pom.xml files as the starting point. Done means imports from mqtt-mapping-interface resolve without Java diagnostics in the extension module.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.