Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Known issue: Spring boot overrides ByteBuddy version as 1.7.11 #80
I'm running mockk:1.8, gradle 4.7, kotlin 1.2.4, java 10, spring boot 2.0.2, lots of other libraries, misc gradle plugins related to spring boot, kotlin, etc.
I successfully converted a simple test to use mockk:
Problem & solution
The test works both in gradle and intellij. However when running in gradle, I get a stacktrace with some apparent null somewhere deep inside mockk. I appears to be non fatal since the test runs and passes. I verified this by intentionally breaking the test, which breaks gradle as well. Intellij runs things without any stacktraces.
Then I noticed gradle doing something funky with the transitive dependency on byte-buddy.
I forced it to use 1.8.8 and that fixes things:
None of my other dependencies seem to be depending on this. Not sure why gradle pulls in 1.7.11.
ByteBuddy 1.8.8 was needed to fix issues with JDK10.
Such exception, of course, may happen if it is downgraded by gradle. I assume it's because of other dependencies depending old bytebuddy.
Thanks for reporting I'll try to figure out how this can be useful.
Full list of dependencies; hope this helps:
and the variables referred:
I would guess you're applying the Spring Boot plugin and using the dependency management plugin. This applies Spring Boot's BOM, and sets the versions from that.
Spring Boot 2.0.3 explicitly sets the ByteBuddy version to 1.7.11. You can see the versions here:
Explicitly defining the dependency as you have done, or configuring your dependencyManagement section are a couple ways to do it.
Dependency versions are still a major problem...