redhat-developer / redhat-developer/vscode-java

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

Open
#4,398 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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.

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

Reproduce the issue in a Windows 11 Gradle multi-module project with Java: Clean Java Language Server Workspace, then inspect the language-server logs while comparing the generated bin/main contents with .\gradlew.bat processResources. Use the reported output-folder and synchronization behavior as the starting points. Done means application.properties remains in the output folder after background synchronization and is available for runtime and debugging.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.