redhat-developer / redhat-developer/vscode-java
imports are not resolved in maven multi module project
Nobody has claimed this yet.
- 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 ...
- I open the project in vcode (extension pack vscjava.vscode-java-pack) and
- navigate to the module
mqtt-mapping-extensionand - open class
mqtt-mapping extension/src/main/java/mqtt/mapping/processor/extension/external/ProcessorExtensionCustomEvent.java - I see the following errors:
The import mqtt.mapping.model cannot be resolvedJava(268435846) mqtt.mapping
in the source editor:
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
- clone the project (https://github.com/SoftwareAG/cumulocity-dynamic-mqtt-mapper/tree/develop)
- navigate to the module
mqtt-mapping-extensionand open classmqtt-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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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