redhat-developer / redhat-developer/vscode-java

Resources (application.properties) automatically deleted from bin folder shortly after generation in Gradle project

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

还没有人认领这个 Issue。

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

描述

Describe the bug
In a Gradle multi-module project environment, the application.properties file is correctly auto-generated/copied into the bin/main folder after a "Clean Java Language Server Workspace" command or project build. However, after approximately 5-10 seconds, the file is automatically deleted from the disk without any user interaction.
To Reproduce
Steps to reproduce the behavior:

  1. Open a Gradle multi-module project in VS Code.
  2. Run the command: Java: Clean Java Language Server Workspace.
  3. Open the file explorer and navigate to the output directory (e.g., project/bin/main).
  4. Observe that application.properties is generated.
  5. Wait for about 5 seconds.
  6. The file disappears from the folder automatically.
Image Image Image

Expected behavior
The language server should copy resources from src/main/resources to the output folder and ensure they persist there for the application to use during runtime and debugging.

Environment

  • Operating System: Windows 11
  • JDK version: 25
  • Visual Studio Code version: v1.104.0
  • Java extension version: v1.54.0

Additional Information

  • This issue occurs specifically in a Gradle setup where the Language Server (Eclipse JDT.LS) seems to have a conflict with the internal build/sync process.
  • Attempting to set a separate output folder (e.g., bin/main/) results in a "Cannot nest output folder" error.
  • The logs show a warning: WARNING: Reflective call to EquinoxBundle#getModuleClassLoader(boolean) detected.
  • A temporary workaround is manually running .\gradlew.bat processResources, but the file is eventually deleted again by the language server's background synchronization.

贡献指南

打开贡献指南

从这里开始

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

调研方向

在使用 Java 的 Windows 11 Gradle 多模块项目中复现该问题:运行 Clean Java Language Server Workspace,然后在将生成的 bin/main 内容与 .\gradlew.bat processResources 进行比较的同时检查 language server 日志。以报告的输出文件夹和同步行为作为起点。完成的标准是:后台同步后 application.properties 仍保留在输出文件夹中,并且可用于运行时和调试。

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

评估

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

把新 issue 发到你的邮箱

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