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

BUG: Erroneous Release 5.1.6/5.1.7 - Does not use documented Spring Boot version. #12472

Closed
codeconsole opened this issue Apr 13, 2022 · 8 comments
Assignees

Comments

@codeconsole
Copy link
Contributor

codeconsole commented Apr 13, 2022

Expected Behavior

According to
https://github.com/grails/grails-core/releases/tag/v5.1.6

Should use Spring Boot 2.6.5, but it points to 2.6.4

Actual Behaviour

% sdk use grails 5.1.6                            

Using grails version 5.1.6 in this shell.
% grails create-app test
% cd test
% grails dependency-report|grep spring-boot
+--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4
|    |    +--- org.springframework.boot:spring-boot:2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.6.4 (*)
+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4 (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4
|    |    +--- org.springframework.boot:spring-boot-actuator:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.5 -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.4 (*)
     |    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4
     +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
\--- org.springframework.boot:spring-boot-devtools -> 2.6.4
     +--- org.springframework.boot:spring-boot:2.6.4
     \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
          \--- org.springframework.boot:spring-boot:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-logging (n)
+--- org.springframework.boot:spring-boot-starter-validation (n)
+--- org.springframework.boot:spring-boot-autoconfigure (n)
+--- org.springframework.boot:spring-boot-starter-actuator (n)
+--- org.springframework.boot:spring-boot-starter-tomcat (n)
+--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4
|    |    +--- org.springframework.boot:spring-boot:2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.6.4 (*)
+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4 (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4
|    |    +--- org.springframework.boot:spring-boot-actuator:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.5 -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|         |    +--- org.springframework.boot:spring-boot-test:2.6.5 -> 2.6.4
|         |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|         +--- org.springframework.boot:spring-boot-test:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4
|    |    +--- org.springframework.boot:spring-boot:2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.6.4 (*)
+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    |    |    +--- org.springframework.boot:spring-boot-starter:2.5.3 -> 2.6.4 (c)
|    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4 (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4
|    |    +--- org.springframework.boot:spring-boot-actuator:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.5 -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|         |    +--- org.springframework.boot:spring-boot-test:2.6.5 -> 2.6.4
|         |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|         +--- org.springframework.boot:spring-boot-test:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4
|    |    +--- org.springframework.boot:spring-boot:2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.6.4 (*)
+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    |    |    +--- org.springframework.boot:spring-boot-starter:2.5.3 -> 2.6.4 (c)
|    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4 (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4
|    |    +--- org.springframework.boot:spring-boot-actuator:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.5 -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.4 (*)
+--- org.springframework.boot:spring-boot-devtools -> 2.6.4
|    +--- org.springframework.boot:spring-boot:2.6.4
|    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
|         \--- org.springframework.boot:spring-boot:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.6.4 (*)
+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    |    |    +--- org.springframework.boot:spring-boot-starter:2.5.3 -> 2.6.4 (c)
|    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4 (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4
|    |    +--- org.springframework.boot:spring-boot-actuator:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.5 -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4
|    |    +--- org.springframework.boot:spring-boot:2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.6.4 (*)
+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4 (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4
|    |    +--- org.springframework.boot:spring-boot-actuator:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.5 -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|         |    +--- org.springframework.boot:spring-boot-test:2.6.5 -> 2.6.4
|         |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|         +--- org.springframework.boot:spring-boot-test:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4
+--- org.springframework.boot:spring-boot-starter-validation -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4
|    |    +--- org.springframework.boot:spring-boot:2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging:2.6.4 (*)
+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    |    |    +--- org.springframework.boot:spring-boot-starter:2.5.3 -> 2.6.4 (c)
|    +--- org.springframework.boot:spring-boot:2.6.5 -> 2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4
|    +--- org.springframework.boot:spring-boot-starter:2.6.4 (*)
|    +--- org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4
|    |    +--- org.springframework.boot:spring-boot-actuator:2.6.4
|    |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|    |    \--- org.springframework.boot:spring-boot-autoconfigure:2.6.4 (*)
+--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4
|    |    +--- org.springframework.boot:spring-boot-autoconfigure:2.6.5 -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-logging -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-actuator -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.4 (*)
|    |    +--- org.springframework.boot:spring-boot-starter-tomcat -> 2.6.4 (*)
|    +--- org.springframework.boot:spring-boot:2.6.4 (*)
|         |    +--- org.springframework.boot:spring-boot-test:2.6.5 -> 2.6.4
|         |    |    \--- org.springframework.boot:spring-boot:2.6.4 (*)
|         +--- org.springframework.boot:spring-boot-test:2.6.4 (*)

Steps To Reproduce

% sdk use grails 5.1.6                            
% grails create-app test
% cd test
% grails dependency-report|grep spring-boot

Environment Information

No response

Example Application

No response

Version

5.1.6

@codeconsole
Copy link
Contributor Author

Using

https://github.com/grails/grails-core/releases/tag/v5.1.7

still points to Spring Boot 2.6.4

@codeconsole codeconsole changed the title BUG: Erroneous Release 5.1.6 - Does not use documented Spring Boot version. BUG: Erroneous Release 5.1.6/5.1.7 - Does not use documented Spring Boot version. Apr 14, 2022
@rainboyan
Copy link
Contributor

This issue was always exist since Grails 5.0.1, because grails-gradle-plugin moved out grails-core, but the versions of Grails and Spring Boot are hard to keep consistent. grails-gradle-plugin is built base on spring-boot-gradle-plugin, grails-core is built upon Spring Boot, two spring-boot versions on the Gradle classpath, Gradle use the version with plugin first, and could not get the Spring Boot version of grails-core.

There is a easy way to set spring-boot version in Grails project:

apply plugin: "io.spring.dependency-management"

dependencyManagement {
    imports {
        mavenBom "org.springframework.boot:spring-boot-starter-parent:$springBootVersion"
    }
}

I submit a PR Support set springBootVersion in Gradle for grails-gradle-plugin, it could be allow us to set springBootVersion in gradle.properties, also could use managed dependency versions that are provided by Spring Boot.

https://grails.org/blog/2021-10-11-grails-5-ga.html

The Grails Gradle Plugin is moved out of grails-core and may follow separate versioning, so you should decouple the grailsVersion Gradle property from grailsGradlePluginVersion in existing applications.

@codeconsole
Copy link
Contributor Author

@rainboyan I understand why, but the release notes specifically say Spring Boot 2.6.5/2.6.6 which is simply not the case.

@codeconsole
Copy link
Contributor Author

codeconsole commented Apr 15, 2022

@rainboyan if I try to use your workaround for forcing the latest Spring Boot, I get the following compile error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> jakarta/annotation/PostConstruct

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileGroovy'.

Caused by: java.lang.NoClassDefFoundError: jakarta/annotation/PostConstruct
        at io.micronaut.aop.InterceptorKind.<clinit>(InterceptorKind.java:55)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

@rainboyan
Copy link
Contributor

Micronaut need `jakarta.annotation:jakarta.annotation-api:2.0.0'

Add the below,

configurations {
    all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            // (5) Micronaut required
            if (details.requested.group == 'jakarta.annotation' && details.requested.name == 'jakarta.annotation-api') {
                details.useVersion '2.0.0'
            }
        }
    }
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

@codeconsole
Copy link
Contributor Author

It seems the correct decision would have been to have released an updated grailsGradlePluginVersion to go with the release.

@puneetbehl puneetbehl self-assigned this Apr 20, 2022
@rainboyan
Copy link
Contributor

@puneetbehl thank you for your hard work. grails gradle plugin 5.1.4 was released!

grailsGradlePluginVersion=5.1.4

@codeconsole
Copy link
Contributor Author

codeconsole commented Apr 21, 2022

I can confirm grailsGradlePluginVersion=5.1.4 works and removes the need to add any more workaround code!

Using it resolves

+--- org.springframework.boot:spring-boot-autoconfigure -> 2.6.6 (*)
+--- org.springframework:spring-webmvc:5.3.19 (*)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants