vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Upgrading gradle wrapper doesn't work for a specific project

Open yuyully opened this issue 2 years ago • 2 comments

Environment
  • Operating System: win 10
  • JDK version: 17.0.3
  • Visual Studio Code version: 1.80.0
  • Java extension version: 1.20.0
Steps To Reproduce
  1. Set java.import.gradle.java.home as jdk17
  2. Clone and open https://github.com/oblac/jodd.git
  3. When it prompts that if upgradle gradle or update jdk, select 'Upgrade Gradle to 7.4.2'
Current Result

Upgrading gradle wrapper doesn't work for this project. However it can work fine for other projects. jodd

Expected Result

Can upgrade gradle wrapper successfully.

yuyully avatar Jul 13 '23 07:07 yuyully

The jod project requires the Gradle Wrapper version 6.4 - https://github.com/oblac/jodd/blob/master/build.gradle#L498 @v-yuyul If you want to upgrade to the 7.4.2 version you can use the following patch:

diff --git a/build.gradle b/build.gradle
index cc306ff08..363e4db43 100644
--- a/build.gradle
+++ b/build.gradle
@@ -495,5 +495,5 @@ static def date() {
 // --- wrapper ----------------------------------------------------------------
 
 wrapper {
-	gradleVersion = '6.4'
+	gradleVersion = '7.4.2'
 }

or

diff --git a/build.gradle b/build.gradle
index cc306ff08..e8c5b3c7a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -491,9 +491,3 @@ static def date() {
        def formattedDate = date.format('yyyyMMdd')
        return formattedDate
 }
-
-// --- wrapper ----------------------------------------------------------------
-
-wrapper {
-       gradleVersion = '6.4'
-}

snjeza avatar Jul 13 '23 14:07 snjeza

Thanks for your comments, @snjeza . It can be upgraded following you steps. But is there any possible to improve the experience? It keeps prompting to upgrade wrapper but actually it's unable to upgrade without manual step, which I don't think it's a good experience.

yuyully avatar Jul 14 '23 02:07 yuyully