redhat-developer / redhat-developer/vscode-java

Compilation error : Java is picking wrong version for dependency resolution for gradle projects

Open
#3,176 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

[Java is picking wrong version for dependency resolution for gradle projects]

Environment
  • Operating System: MAC M1
  • JDK version: 17
  • Visual Studio Code version: latest
  • Java extension version: latest
Steps To Reproduce

My Project is working with intellij but not in the vscode

(check image below)also the junit 4.3 is registed as dependency in the nested project build.gradle file and 4.2 is transitive dependency
the transitive dep is prioritizing the the registered version
because of this im getting errors in java file

  1. [step 1] create a gradle nested project and add same dependency (transitive) with different versions
  2. [step 2] this plugin is resolving the lowest version of plugin instead of greatest version of above
Current Result
image
Expected Result

4.3 should be taken priority than 4.2

Additional Informations

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 with a nested Gradle project on macOS using JDK 17, following the described dependency declarations in the nested project's build.gradle. Compare the resolved versions for the direct 4.3 dependency and transitive 4.2 dependency with IntelliJ and VS Code. Done means VS Code resolves and uses 4.3, without the reported Java-file errors.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.