redhat-developer / redhat-developer/vscode-java

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

未关闭
#4,317 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在 VS Code 中使用 Gradle for Java 扩展和 Java Language Server,通过一个 Java 多模块 Gradle 项目重现该故障。比较初始加载与运行 "Java: Clean Java Language Server Workspace" 后重新加载或重新打开的情况;当项目无需再次清理工作区即可保持一致时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, vscode
领域
build-system, developer-experience, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
50/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。