redhat-developer / redhat-developer/vscode-java

Gradle multi-module project breaks on reload, requires cleaning Java Language Server workspace every time

Open
#4,317 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
I am working with a Java Gradle multi-module project in VS Code.
On the first load, the project fails with an error like:

The project was not built due to "xxx does not exist". Fix the problem, then try refreshing this project and building it since it may be inconsistent.

The suggested workaround is:

  • Disable Gradle for Java extension
  • Run "Java: Clean Java Language Server Workspace"
  • Reload the project

This workaround does fix the problem, but only temporarily.


Problem
Every time I:

  • reload the window, or
  • close and reopen the project

I have to run "Java: Clean Java Language Server Workspace" again, otherwise the same error appears.

This makes working with the project very inconvenient.


Expected behavior
Once the project is cleaned and loaded successfully:

  • It should stay in a consistent state
  • Reloading or reopening the project should not require cleaning the Java Language Server workspace again

Actual behavior

  • Project breaks again after reload
  • Same error repeats
  • Manual workspace cleaning is required every time

Environment

  • VS Code
  • Java multi-module Gradle project
  • Java Language Server
  • Gradle for Java extension enabled

Additional notes
This looks like a workspace cache or Gradle project import inconsistency issue.
It seems the Java Language Server does not correctly persist the resolved multi-module Gradle state across reloads.

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 by reproducing the failure in VS Code with a Java multi-module Gradle project, using the Gradle for Java extension and the Java Language Server. Compare the initial load with reload or reopen after running "Java: Clean Java Language Server Workspace"; done means the project remains consistent without cleaning the workspace again.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
build-system, developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.