Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven multi-module project doesn't correctly open modules #766

Closed
vitalyla opened this issue May 19, 2023 · 16 comments · Fixed by #791
Closed

Maven multi-module project doesn't correctly open modules #766

vitalyla opened this issue May 19, 2023 · 16 comments · Fixed by #791
Labels
bug Something isn't working
Milestone

Comments

@vitalyla
Copy link

vitalyla commented May 19, 2023

Hi there,

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

java-projects-pane-multimodules

@jdneo
Copy link
Member

jdneo commented May 22, 2023

Could you provide a sample project and reproduce steps?

@vitalyla
Copy link
Author

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

image

@jdneo
Copy link
Member

jdneo commented May 25, 2023

image

Is that because of the typo? endpoints not endpionts

@charleech
Copy link

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.

@vitalyla
Copy link
Author

@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.

@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
Copy link
Member

jdneo commented 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
Copy link

rossinineto commented 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
Copy link
Author

Hi,

Any update/progress on the issue? It makes it very problematic to work with multimode projects.

@rossinineto
Copy link

The problem still happens!

@vitalyla
Copy link
Author

Hi @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
Copy link
Member

jdneo commented 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 @fvclaus. The issue is addressed for the attached project.

I'll ask @fvclaus if he is willing to raise a PR for that since he is the one finds out the root cause.

@vitalyla
Copy link
Author

Thanks, @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
Copy link
Member

jdneo commented Sep 22, 2023

I will keep an eye on this and try to make at least a pre-release for the fix.

@vitalyla
Copy link
Author

vitalyla commented Oct 4, 2023

Hi @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
Copy link
Member

jdneo commented Oct 5, 2023

The solution provided in #791 should handle those cases. It's working in progress now please stay in tune.

@jdneo jdneo closed this as completed in #791 Oct 8, 2023
@jdneo jdneo added this to the 0.24.0 milestone Oct 8, 2023
@jdneo jdneo added the bug Something isn't working label Oct 8, 2023
@jdneo
Copy link
Member

jdneo commented Oct 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants