You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Maven multi-module project doesn't correctly open modules #766
Since recent update to new version of an extension, the incorrect behavior was noticed when importing multi-module Maven project. When importing the "parent" project, the child modules are not getting resolved as Java projects in "Java Projects" pane. Also, when selecting the "pom.xml" file shown under any of the child "module", the parent's "pom.xml" is opened instead in the editor. The "explorer" view shows the structure correctly.
The POM structure of both "parent" and child modules, was re-checked several times and the same works well in other editors. When importing child modules alone, one by one or both together, they open as expected. The problem is noted only when importing "parent" POM with "modules" inside it.
Environment:
Project Manager for Java version: v0.22.0
VS Code version: v1.78.2
Sure. Please find attached the multi-module project that has that issue. Also below is the snapshot how it looks like in VS Code when tried to be loaded.
I used to face this issue once with the following environment.
OS: Windows 11 Home Single Language 22H2
VS Code version 1.78.2
Extension Pack for Java version 0.25.11
Project Manager for Java version 0.22.0
I have tried to Refresh, Clean Workspace , close the VSCode and re-open many times but nothing help. The Java Project View still display only some maven modules and some of them were not be displayed.
Then I start from scratch by opening the empty VSCode, then choosing File --> Add Folder to Workspace...
At this time the Java Project View is able to display all my maven module properly.
IMHO, there may be something in the mist with File --> Open Folder that block the Java Project View so that it is not able to list all maven sub module in the project hierarchy.
Sheng Chen (@jdneo) I apologizes, noticed the typo late. Attached is the corrected version. However, same behavior once typo is fixed. The same project opens correctly in Eclipse IDE though.
One more observation, is when I create similar hierarchy "from scratch", using Maven archetypes or manually, and importing it using the same steps as problematic project, the former ones opens correctly, without any issues.
An attached archive is similar to the real project, and was copy-pasted as is just with replacement of Java files and artifact names in the POM. The structure is the same.
With update 0.23 this problem still persists,
when you have a workspace with two or more java project folders added
and these projects has a parent project.
did you have a chance to work on the problem? It is really impossible to work with true multi-maven project with VSCode and requires to find different workarounds.
With a recent update of VSCode it seems like some issues were resolved, at least I can load some modules but with only one level depth. When hierarchy goes to 3 levels then behaviour is the same as outlined in this issue and the linked ones. I understand that referred items are still open and it would be great if tests will cover different depth levels of projects with some reasonable number 5-10.
Sorry it's a little bit late since the issue is reported. I just kicked off a pre-release 0.23.2023100802 containing the fix. Users should receive the update notification after couple hours.
Activity
jdneo commentedon May 22, 2023
Could you provide a sample project and reproduce steps?
vitalyla commentedon May 24, 2023
Sure. Please find attached the multi-module project that has that issue. Also below is the snapshot how it looks like in VS Code when tried to be loaded.
mvn-multimodule-test.tar.gz
jdneo commentedon May 25, 2023
Is that because of the typo? endpoints not endpionts
charleech commentedon May 25, 2023
I used to face this issue once with the following environment.
OS: Windows 11 Home Single Language 22H2
VS Code version 1.78.2
Extension Pack for Java version 0.25.11
Project Manager for Java version 0.22.0
I have tried to
Refresh,Clean Workspace, close the VSCode and re-open many times but nothing help. TheJava Project Viewstill display only some maven modules and some of them were not be displayed.Then I start from scratch by opening the empty VSCode, then choosing
File --> Add Folder to Workspace...At this time the
Java Project Viewis able to display all my maven module properly.IMHO, there may be something in the mist with
File --> Open Folderthat block theJava Project Viewso that it is not able to list all maven sub module in the project hierarchy.vitalyla commentedon May 25, 2023
Sheng Chen (@jdneo) I apologizes, noticed the typo late. Attached is the corrected version. However, same behavior once typo is fixed. The same project opens correctly in Eclipse IDE though.
Charlee Chitsuk (@charleech) Thank you for suggested steps, I tried those, but no success.
One more observation, is when I create similar hierarchy "from scratch", using Maven archetypes or manually, and importing it using the same steps as problematic project, the former ones opens correctly, without any issues.
An attached archive is similar to the real project, and was copy-pasted as is just with replacement of Java files and artifact names in the POM. The structure is the same.
mvn-multimodule-test.tar.gz
jdneo commentedon May 25, 2023
Thank you for the update. I can reproduce this issue on my side. I will debug into the extension to see what happens later.
rossinineto commentedon Jun 15, 2023
With update 0.23 this problem still persists,
when you have a workspace with two or more java project folders added
and these projects has a parent project.
Downgraded to 0.21.2 to solve the problem.
vitalyla commentedon Jul 12, 2023
Hi,
Any update/progress on the issue? It makes it very problematic to work with multimode projects.
rossinineto commentedon Sep 9, 2023
The problem still happens!
vitalyla commentedon Sep 20, 2023
Hi Sheng Chen (@jdneo),
did you have a chance to work on the problem? It is really impossible to work with true multi-maven project with VSCode and requires to find different workarounds.
jdneo commentedon Sep 21, 2023
Sorry for the late reply. I looked into it today and find the root cause is the same as #788.
I can confirm that after applying the change proposed by Frederik Claus (@fvclaus). The issue is addressed for the attached project.
I'll ask Frederik Claus (@fvclaus) if he is willing to raise a PR for that since he is the one finds out the root cause.
vitalyla commentedon Sep 21, 2023
Thanks, Sheng Chen (@jdneo)!
I checked the description of linked issue and it seems indeed the problem. Looking forward when it is going to be part of the next VSCode update.
jdneo commentedon Sep 22, 2023
I will keep an eye on this and try to make at least a pre-release for the fix.
vitalyla commentedon Oct 4, 2023
Hi Sheng Chen (@jdneo),
With a recent update of VSCode it seems like some issues were resolved, at least I can load some modules but with only one level depth. When hierarchy goes to 3 levels then behaviour is the same as outlined in this issue and the linked ones. I understand that referred items are still open and it would be great if tests will cover different depth levels of projects with some reasonable number 5-10.
jdneo commentedon Oct 5, 2023
The solution provided in #791 should handle those cases. It's working in progress now please stay in tune.
jdneo commentedon Oct 8, 2023
Sorry it's a little bit late since the issue is reported. I just kicked off a pre-release
0.23.2023100802containing the fix. Users should receive the update notification after couple hours.