redhat-developer / redhat-developer/vscode-java
Gradle project infinitely rebuilds after launching a project
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
jls_before_run.log
jls_after_run.log
I have a multi-project Gradle project. It is not using any Eclipse settings (meaning no .project, .classpath, etc. files). The projects uses annotation processors to generate source files (they are generated under build/generated/sources/annotationProcessor/java/main by Gradle).
When the workspace is initially loaded, it works fine. The problems start after you launch a Java main class. It appears that the language server is constantly detecting changes in source files and somehow falls into an infinite loop where it continuously builds itself. It gets so bad that the workspace starts reporting compiler errors, even though there are none.
I'm not sure which factors are causing this issue to happen, so I can't provide a project that reproduces the issue. It might be a combination of Gradle with sub-projects, annotation processors, and the sheer size of the codebase. I tried changing some settings that I thought might be related to this issue with no success. I tried the current and pre-release Java Language Pack versions and the behavior is the same.
Attached are the language server logs. jls_before_run.log are the logs before I launched a main class. jls_after_run.log are the logs after I launched a main class. jls_after_run.log would have run into infinity, so I had to eventually manually stop it, so I hope there's enough information to get a clue on what's happening.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the attached jls_before_run.log and jls_after_run.log, focusing on changes after launching a Java main class in the multi-project Gradle workspace. Reproduce the annotation-processor setup if possible and trace the repeated source-change and build events; done means the workspace stops rebuilding and no longer reports false compiler errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100