-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Support Snakeyaml 1.20+ #13191
Comments
Looks like there's a method signature change from 1.19 -> 1.20. I guess officially we only support 1.19 in Boot 2.0 but I'll look to see if we can do some reflection hackery to also support 1.20. |
I've just been looking and it's nasty because part of the breaking API change is in a constructor of |
Just in case it's useful, the failure can be reproduced with this test: @RunWith(ModifiedClassPathRunner.class)
@ClassPathOverrides("org.yaml:snakeyaml:1.20")
public class OriginTrackedYamlLoaderSnakeYamlCompatibilityTests
extends OriginTrackedYamlLoaderTests {
} |
That'd be greatly appreciated if its doable. I think beyond that, the big thing to ask for here is alignment between Spring core and Spring boot deps like this. I personally have no opinions on snakeyaml versions, but just having the latest of Boot and Core and normal conflict resolution (for gradle at least) gets me into a bad state. The dependency management plugin hides this by forcing versions from Boot, but then causes other problems when what I wanted was conflict resolution. So if Spring Framework and Spring Boot can stay aligned on dependencies like this within their respective major releases, it would just help prevent things like this from happening. |
We should probably raise this with the Framework team as I'm not sure that they're aware of how Gradle is now interpreting versions in a pom's optional dependencies and the effect it can have on dependency resolution. We should also raise it with the Gradle team as well as I'm not sure they're fully aware of the implications. While Framework compiles against 1.20, it's also compatible with earlier versions. As the dependency is declared optional in its pom, it's not expected that the version Framework compiles against will have any effect on dependency resolution in a consuming build. That's Maven's behaviour and has, I believe, been Gradle's behaviour until recently. Building on this expectation, Framework has moved from 1.19 to 1.20 in a 5.0.x maintenance release. Due to Gradle interpreting Maven metadata in a different way to how Maven does (and how library publishers expect), this change causes problems as upgrading to a new Framework 5.0.x build inadvertently upgrades SnakeYAML from 1.19 to 1.20. |
I've opened gradle/gradle#5434. |
Hi all, do you need any support in SnakeYAML ? |
@asomov Thanks very much for asking. The problem with supporting 1.20 alongside 1.19 that we already support, is this backwards incompatible change. While we can use reflection to cope with the change in the signature of Perhaps there's an alternative approach that would work with both 1.19 and 1.20? |
Well, I do not see a solution to support both. I updated the changes to mention backwards-incompatible contributions. By the way, they were made to line up SnakeYAML to its YAML 1.2 brother. |
It occurred the same problem in Boot 2.0.4 RELEASE with 1.21 snakeyaml, but i found it can ran correctly on 1.19. What happened. |
1.22 adds back the removed methods making it backwards compatible with 1.19 |
Thank you for your reply. Another question, when will the 1.22 release? |
SnakeYAML 1.22 has been already released. |
As far as I can tell from my testing with 1.22 and spring boot 2.04.RELEASE this is still broken
|
Indeed in the pull request the constructors are restored (by overloading) but the getters cannot be overloaded. |
@jisikoff : can you please help me to fix it ? I have re-open the issue for SnakeYAML Can you please try the latest 1.23-SNAPSHOT ? It is already available in the Sonatype repository I have added another getter with the new signature and restored the old signature for getter. We can better follow the progress in the issue tracker for SnakeYAML. |
@asomov will give it a try |
@asomov 1.23-SNAPSHOT seems good! might want to have some other people/projects give it a try but looks good with my particular spring boot 2.04.RELEASE project which now both passes tests and starts up fine |
We will make a release today. |
SnakeYAML 1.23 has been released (let us hope it can solve most of the issues with backwards compatibility) |
@twicksell : should the issue be closed ? You can test it with SnakeYAML 1.23 |
@asomov I'll have a look, upgrading to 1.23 on |
I would like to create a pull request to get rid of deprecated methods. Should I better wait for your upgrading on master ? |
@asomov thanks for offering to submit a PR. Please go ahead on Given the state of affair, we won't update Duplicate of #14218 |
Pull request: #14224 (this is for release 2.1.0) |
How exactly? Please advise. |
@asarkar Please ask questions on Stack Overflow. You can also find guidance on overriding a dependency's version in the reference documentation. |
When running Spring Boot 2.0.2 we see the following error when Snakeyaml 1.20 is on the classpath. This occurs when we do not use the dependency management plugin, and have Spring Framework 5.0.4+ on the classpath which introduced Snakeyaml 1.20.
The text was updated successfully, but these errors were encountered: