vscode-java-dependency icon indicating copy to clipboard operation
vscode-java-dependency copied to clipboard

Maven module is not loading properly as a Java project when the module directory name is different from it's artifactID

Open viswatejan opened this issue 2 years ago • 1 comments
trafficstars

Describe the bug When a multi-module maven project is opened in VS Code and the child module directory names are not the same as their artifactIDs, the Maven extension is recognizing that as a module and also loads the modules as a Java project but the sources are not listed under the Java project.

To Reproduce Steps to reproduce the behavior:

  1. Create a multi-module maven project.
  2. Name the child module directories child1, child2, etc.
  3. Name the child modules' artifactID as child-1, child-2, etc.
  4. Add some Java classes under the src/main/java/ directory under those child modules.
  5. Open the multi-module project in VSCode

Expected behavior

  • It should load all the child modules including the parent in the Maven panel (this is working fine).
  • It should load all the modules as Java projects under Java Projetcs panel (this is also working fine).
  • Expand those Java projects, it should recognize the source and test classes and it should list them along with the JDK and maven dependencies as shown below (this is not working). image

Environments (please complete the following information as much as possible):

  • OS: OS X
  • VS Code version: 1.81.0
  • Extension version: 0.42.0

Screenshots This is the file structure with bundle, providers, sso-redirect, themes are my child modules with the artifactIds lib_security_rhsso_bundle, lib_security_rhsso_providers, lib_security_rhsso_redirect, lib_security_rhsso_themes respectively. image

Recognized the maven modules and loaded them as Java projects but did not load the appropriate source and test classes with the Java and Maven dependencies in the Java Project view. image

Additional context If I use the same name for the directory name and the artifactId of the module, it is working fine.

viswatejan avatar Aug 11 '23 20:08 viswatejan

Transfer to the right repo since this issue is related to Java Projects view.

testforstephen avatar Aug 15 '23 01:08 testforstephen