-
Notifications
You must be signed in to change notification settings - Fork 41
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
READ_DATE_TIMESTAMPS_AS_NANOSECONDS when rewrite Spring Boot 2.7 to 3.x #348
Comments
Thanks for the detailed analysis already @nicolasb29 ; Can't say I've heard of these issues before. Quickly glancing at recipes we seem to have this one: https://github.com/openrewrite/rewrite-migrate-java/blob/cd36280b91d497086e220e965f2af3106e786ebf/src/main/resources/META-INF/rewrite/jakarta-ee-9.yml#L805-L810 |
Yes it's a problem while the task |
So my guess is the Spring Dependency Management plugin is the cause of the issues. It utilizes a Gradle resolutionStrategy which forces the versions across all Gradle configurations to the one that would come from the Spring Boot Gradle plugin (ie. org.springframework.boot:spring-boot-dependencies). Ultimately this would have forced OpenRewrite's Jackson version to likely be different (in this case down). |
One solution is to force the dependencies like in this PR.
|
Yeah, I'm not 100% sure given any dependency that appears in a BOM imported into the Spring Dependency Management plugin would be potentially impacted. So this feels a little like a stop-gap. Honestly, I've wondered if the Spring Dependency Management plugin should be a little more reserved in its behavior, but right now it would be a continually moving target. |
In this example, there is also a problem with snake yaml with errors like this There were problems parsing |
Hi, I think that you have to keep the detached configuration to resolve dependencies in isolated mode. I have updated the PR. I have added this code in the afterEvaluate block of my init.gradle to print dependencies:
|
Hi,
I'm using OpenRewrite to migrate Spring Boot 2.7 to Spring Boot 3.x, like a lot of people I think, but since the version 6.28.0 I have this error :
java.lang.RuntimeException: Error while visiting build.gradle: java.lang.NoSuchFieldError: Class com.fasterxml.jackson.annotation.JsonFormat$Feature does not have member field 'com.fasterxml.jackson.annotation.JsonFormat$Feature READ_DATE_TIMESTAMPS_AS_NANOSECONDS'
I made a project on GitHub to show the problem:
I made a Gradle dependencies and it seems that
com.fasterxml.jackson
is downgraded from 2.17.2 to 2.13.5 (version in dependency of Spring Boot 2.7.18, cause of the problem ?). The annotationREAD_DATE_TIMESTAMPS_AS_NANOSECONDS
was included in version 2.15.Best regards.
The text was updated successfully, but these errors were encountered: