I believe I have encountered a dependency management issue with Spring Boot 2.3.4 when upgrading from 2.3.3
The salient points I think are: * Managed Spring Boot dependencies * Using Spring Boot Starter Web * Using Spring Boot Starter Test as a test dependency * Using Stubby4j 6.0.2 as a test dependency
When changing the Spring Boot version from 2.3.3 to 2.3.4, the Spring Boot tests fail to start with:
java.lang.NoSuchMethodError: org.yaml.snakeyaml.LoaderOptions.setMaxAliasesForCollections(I)V
at org.springframework.boot.env.OriginTrackedYamlLoader.createYaml(OriginTrackedYamlLoader.java:67)
I have created a minimal reproducible example with instructions at https://github.com/josephearl/spring-boot-stubby4j-example.
The Java version doesn't seem to matter as evidenced by https://github.com/josephearl/spring-boot-stubby4j-example/actions/runs/283147116.
I've tried with both the default compiler and Groovy Eclipse compiler, it happens with both.
AFAIK the version of Snake YAML hasn't changed between 2.3.3 and 2.3.4, and Snake YAML is a managed dependency, so it's not clear to me why this happens with 2.3.4.
The workaround (fix?) is simple, exclude Snake YAML from the Stubby4j dependency, but again I'm not clear on why this should be needed.
(Edit: removed Groovy from description, although the test was originally written in Groovy and using Groovy Eclipse compiler for compilation this still happens with the test written in Java using the default compiler)
Comment From: josephearl
Closing because this seems Stubby4j specific - Stubby4j 6.0.2 depends on Snake YAML 1.23. If I replace Stubby4j with something else that depends on that version of Snake YAML, such as Apache Commons Configuration 2.4, the test passes.
Comment From: josephearl
This is because the default Stubby4j dependency is a fat jar - use the no-dependencies classifier and everything is dandy.