redhat-developer / redhat-developer/vscode-java

"Project cannot be built until its prerequisite is built" errors each time I close & open VSCode

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

还没有人认领这个 Issue。

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

描述

I have a multi-module Maven project that I created using Eclipse, and now I am trying to migrate to VSCode.

I have opened the project in VSCode, and it has updated all .project and .classpath files. There is no error in the project, and everything seems to work perfectly.
But after I close VSCode and open it again, without having changed a single line, after Java builds everything, suddenly most of the modules are in red, and I see this type of error in the Problems tab:

"The project cannot be built until its prerequisite XXX is built. Cleaning and building all projects is recommended"

If I "Clean Java Language Server Workspace", the problems disappear, until I close+open VSCode again.
If I "Force Java Compilation > Full", the same. Problems disappear until the next restart.

I guess this shouldn't happen, but I don't know if it is a problem in my project (as I've said, everything works until I close the workspace), I have something configured incorrectly or it is a bug in vscode-java (and if so, if there's any workaround).

I am using JDK 8.

I have tried the pre-release version too, but I get the same problems.

Thank you in advance, please let me know if you need more info.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,在重新打开 VSCode 后使用多模块 Maven 项目复现该故障,并比较 Java 构建前后的 .project 和 .classpath 文件。检查清理 Java Language Server Workspace 或使用 Force Java Compilation > Full 是否会改变结果。完成的标准是确定与重启相关的原因,或找到针对先决条件错误的可靠解决方法。

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

评估

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

把新 issue 发到你的邮箱

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