Skip to content

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

Closed

Description

@vitalyla

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

Activity

  1. jdneo commented on May 22, 2023

    @jdneo
    Member

    Could you provide a sample project and reproduce steps?

  2. vitalyla commented on May 24, 2023

    @vitalyla
    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
  3. jdneo commented on May 25, 2023

    @jdneo
    Member

    image

    Is that because of the typo? endpoints not endpionts

  4. charleech commented on May 25, 2023

    @charleech

    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.

  5. vitalyla commented on May 25, 2023

    @vitalyla
    Author

    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

  6. jdneo commented on May 25, 2023

    @jdneo
    Member

    Thank you for the update. I can reproduce this issue on my side. I will debug into the extension to see what happens later.

  7. rossinineto commented on Jun 15, 2023

    @rossinineto

    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.

  8. vitalyla commented on Jul 12, 2023

    @vitalyla
    Author

    Hi,

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

  9. rossinineto commented on Sep 9, 2023

    @rossinineto

    The problem still happens!

  10. vitalyla commented on Sep 20, 2023

    @vitalyla
    Author

    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.

  11. jdneo commented on Sep 21, 2023

    @jdneo
    Member

    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.

  12. vitalyla commented on Sep 21, 2023

    @vitalyla
    Author

    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.

  13. jdneo commented on Sep 22, 2023

    @jdneo
    Member

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

  14. vitalyla commented on Oct 4, 2023

    @vitalyla
    Author

    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.

  15. jdneo commented on Oct 5, 2023

    @jdneo
    Member

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

  16. added this to the 0.24.0 milestone on Oct 8, 2023
  17. jdneo commented on Oct 8, 2023

    @jdneo
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions