Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Boot plugin requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 6.4 (On Gradle 7.4!) #19896

Closed
elmsleypass opened this issue Feb 11, 2022 · 7 comments
Labels
closed:not-fixed Indicates the issue was not fixed and is not planned to be

Comments

@elmsleypass
Copy link

elmsleypass commented Feb 11, 2022

I am using spring boot 2.6.2. The filter is wrong.

Spring Boot plugin requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 6.4

--
And this is after i typed:
"gradle wrapper --gradle-version 7.4"

Which is weird because it's saying 6.4, but it should be detecting 7.4.

@elmsleypass elmsleypass changed the title Spring Boot plugin requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 6.4 Spring Boot plugin requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 6.4 (On Gradle 7.4!) Feb 12, 2022
@rpalcolea
Copy link
Contributor

That seems strange. If you generate a project in https://start.spring.io/, it definitely works.

Any chance your project is/was in an old version of gradle and you tried ./gradlew wrapper --gradle-version 7.4 ? If that's the case it might be expected since Gradle won't be able to configure your project due to the spring boot gradle plugin check and won't be able to execute the Wrapper task. In that case, changing the gradle-wrapper.properties file directly to 7.4 might be the way to go.

Also, the logic is owned by spring boot and not really Gradle itself -> https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java#L99-L105

@elmsleypass
Copy link
Author

Ah. This does work, and changing the property file directly works too!

./gradlew wrapper --gradle-version 7.4

@jbartok jbartok added to-triage closed:not-fixed Indicates the issue was not fixed and is not planned to be labels Feb 14, 2022
@jbartok
Copy link
Member

jbartok commented Feb 14, 2022

Seems like the problem is solved, pls. let us know otherwise.

@elmsleypass
Copy link
Author

Hmm, I still think it may be gradle

private void verifyGradleVersion() {
	GradleVersion currentVersion = GradleVersion.current();
	if (currentVersion.compareTo(GradleVersion.version("6.8")) < 0) {
		throw new GradleException("Spring Boot plugin requires Gradle 6.8.x, 6.9.x, or 7.x. "
				+ "The current version is " + currentVersion);
	}
}

If this says 6.4, then GradleVersion.current() is what is returning that value.

@bjornvester
Copy link
Contributor

Are you sure you are running the wrapper (gradlew with a w) and not a manually downloaded distribution (gradle with no w) you have put in your path variable?

@elmsleypass
Copy link
Author

Ah! You are right, sorry for the confusion. my installed gradle happened to be 6.4. After updating that version, I have no issues. Thanks!

@AndyLau223
Copy link

Thanks, the solution works fine for me!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:not-fixed Indicates the issue was not fixed and is not planned to be
Projects
None yet
Development

No branches or pull requests

5 participants