redhat-developer / redhat-developer/vscode-java

Gradle "includeBuild" no longer recognizes imported classes in the IDE

Open
#3,589 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Gradle
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

When utilizing "includeBuild" in the settings.gradle file, the IDE no longer recognizes java imports/objects from the included project. Compiling in gradle via the command line continues to work as expected.

Environment
  • Operating System: Windows
  • JDK version: 1.8/17
  • Visual Studio Code version: 1.88.1
  • Java extension version: 1.29
Steps To Reproduce
  1. Run gradle init to generate a java library called 'inc1'
  2. Run gradle init to generate a java library called 'inc2'
  3. Add 'group="inc2"' to inc2 build.gradle
  4. Add includeBuild '..\\inc2' to the inc1 settings.gradle file
  5. Add implementation "inc2:lib:1.0.0" to inc1 build.gradle dependencies
  6. Create class Lib2.java in the inc2 project
  7. Import and instantiate the Lib2 object in the inc1 project
  8. Run gradle assemble in inc1 and verify success
  9. Open inc1 in VSCode and verify it can not locate the Lib2 object

[Sample Project]

Current Result

The Lib2 import cannot be resolved in VSCode

Expected Result

The Lib2 import can be resolved in VSCode

Additional Informations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked sample project and reproduce the issue using inc1/settings.gradle, inc1/build.gradle, and the included inc2 project; compare successful gradle assemble output with VS Code's unresolved Lib2.java import. Trace the Java extension's handling of the includeBuild dependency, and consider the issue done when the Lib2 import resolves in VS Code while the Gradle build still succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.