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

Dependency management issue with Spring Boot 2.3.4 and Snake YAML #23563

Closed
josephearl opened this issue Oct 1, 2020 · 2 comments
Closed

Dependency management issue with Spring Boot 2.3.4 and Snake YAML #23563

josephearl opened this issue Oct 1, 2020 · 2 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@josephearl
Copy link

josephearl commented Oct 1, 2020

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)

@josephearl josephearl reopened this Oct 1, 2020
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 1, 2020
@josephearl josephearl changed the title Dependency management issue with Spring Boot 2.3.4 Dependency management issue with Spring Boot 2.3.4 and Snake YAML Oct 1, 2020
@josephearl
Copy link
Author

josephearl commented Oct 1, 2020

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.

@scottfrederick scottfrederick removed the status: waiting-for-triage An issue we've not yet triaged label Oct 1, 2020
@josephearl
Copy link
Author

This is because the default Stubby4j dependency is a fat jar - use the no-dependencies classifier and everything is dandy.

@snicoll snicoll added the status: invalid An issue that we don't feel is valid label Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants