redhat-developer / redhat-developer/vscode-java

Declared package "xxx.yyy.zzz" does not match the expected package "src.main.xxx.yyy.zzz" on nested Maven project

Open
#3,784 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm getting error in title for Maven my Maven project xxx.yyy.zzz. I have opened workspace with more folders and (from root) my Maven project path is src/main/xxx/yyy/zzz/File.java. When File.java is opened, error in title is shown. When I try to change my package declaration to src.main.xxx.yyy.zzz in an effort to at least get rid of the error temporary, error is raised again with switched values - Declared package "src.main.xxx.yyy.zzz" does not match the expected package "xxx.yyy.zzz" on nested Maven project.

Environment
  • Operating System: Mac OS 14.6.1
  • JDK version: 17.0.6
  • Visual Studio Code version: 1.93.0
  • Java extension version: 1.35.0
Steps To Reproduce
  1. [step 1]
  2. [step 2]

[Please attach a sample project reproducing the error]
Please attach logs

Current Result
Expected Result
Additional Informations

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

Start by reproducing the reported layout with File.java under src/main/xxx/yyy/zzz in a nested Maven project opened from the workspace root. Compare the declared package with the package expected by the Java extension, and gather the sample project and logs requested in the issue. Done means the diagnostic consistently uses the nested Maven project's package root.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.