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

Bug #1401

Open
Dimitar-Tagarev-IBM opened this issue Feb 10, 2025 · 0 comments
Open

Bug #1401

Dimitar-Tagarev-IBM opened this issue Feb 10, 2025 · 0 comments

Comments

@Dimitar-Tagarev-IBM
Copy link

Dimitar-Tagarev-IBM commented Feb 10, 2025

Environment:

  • VS Code Version: latest
  • Extension Version: latest on all, but on Gradle for java 3.7.0
  • JDK Type & Version: 17
  • OS Type & Version: Windows 10

Summary
We are currently trying to migrate our project from Intellij into Vs code.
Our project is a multi project Gradle build with a Gradle wrapper in the root directory that is importing the other sub projects. The Gradle version we are using in 7.3.3 and the java is 17.
We are using are "The Extension pack for java", but it turned out that the Gradle for Java plugin in vs code doesn't support the older versions of Gradle that we are using and we need to go to an older version of the plugin for the project to be loaded normally. This is based on this issue microsoft/vscode-gradle#1585 and we applied the solution there and downgraded the Gradle extension to the 3.7.0 version and that fixed this problem, enabling us to build it correctly.

Issue
Then we hit the problem:
"Multiple projects in the build are located in the same directory"

We are facing an issue coming from the Language Support for Java(TM) by Red Hat extension where, despite proper Gradle configuration and the use of the Gradle wrapper, we are receiving an error regarding "Multiple projects in the same directory." This error appears during project synchronization, even though the project structure seems valid, and the same issue does not occur when using IntelliJ IDEA.
This is screenshot from the log of the Language Support for java extension:

Image

Since the VS Code Gradle extension is based on Eclipse’s Buildship plugin, we investigated relevant settings in the Buildship configuration (org.eclipse.buildship.core.prefs), but they did not resolve the problem.

Additional Environment info
Currently this is our Gradle project structure and we are having this problems for modules like E or K.

Root project 'A'
+--- Project ':B'
|    +--- Project ':B:B1'
|    +--- Project ':B:B2'
|    +--- Project ':B:B3'
     ... (and so on)
+--- Project ':C'
|    +--- Project ':C:C1'
|    +--- Project ':C:C2'
|    +--- Project ':C:C3'
     ... (and so on)
+--- Project ':D'
|    --- Project ':D:D1'
+--- Project ':E'
|    +--- Project ':E:E1'
|    +--- Project ':E:E2'
|    +--- Project ':E:E3'
     ... (and so on)
+--- Project ':F'
|    +--- Project ':F:F1'
|    +--- Project ':F:F2'
|    +--- Project ':F:F3'
     ... (and so on)
+--- Project ':G'
+--- Project ':H'
|    +--- Project ':H:H1'
|    +--- Project ':H:H2'
|    +--- Project ':H:H3'
     ... (and so on)
+--- Project ':I'
+--- Project ':J'
--- Project ':K'
|    +--- Project ':K:K1'
|    +--- Project ':K:K2'
|    +--- Project ':K:K3'
|    --- Project ':K:K4'

The settings.json we are using are right now is:
{
    "java.jdt.ls.java.home": "C:\Program Files\Zulu\zulu-17",
    "java.import.gradle.java.home" : "C:\Program Files\Zulu\zulu-17",  
    "java.import.gradle.enabled": true,
    "java.import.gradle.wrapper.enabled": true,
    "java.configuration.updateBuildConfiguration": "interactive",
 }

we are not using the
 "gradle.multiProject": true,
 "gradle.nestedProjects": true,
 because the importing of the subproject is handled in our gradle wrapper and if there settings are added the gradle is not building correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant