redhat-developer / redhat-developer/vscode-java
Maven project inside another maven project not recognized
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
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
- Create new maven project (using maven for java extension)
- 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
- Import Java Projects into Workspace
- Observe only
test_projectis properly imported in this case - Open a new window: File > New Window
- Inside new window, open
sub_project: File > Open Folder > selectsub_project - Observe
sub_projectcan 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
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
Reproduce the workspace using the nested pom.xml files described in the issue, then compare Import Java Projects with opening sub_project alone. Start by tracing the project-import entry point and how the extension discovers pom.xml files. Done means nested projects are recognized recursively and SubMain.java no longer reports that it is outside the classpath.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- 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