Ninja-Squad/springmockk

Upgrade to mockk 1.12.7

stefanzilske opened this issue ยท 6 comments

mockk 1.12.7 introduced new Kotlin multiplatform build, which is not backwards compatible (cf. mockk/mockk#868 (comment))

springmockk 3.1.1. uses mockk 1.12.4, so not I have to exclude mockk from my springmockk dependency everywhere I use it.

Hi @stefanzilske

Could you please elaborate a bit more? I still see mockk being released under the same coordinates (io.mockk:mockk). If I understand correctly, they also released it under the coordinates io.mockk:mockk-jvm coordinate, is that right?

If that's right, I'd say that's a pretty bad move on their part. Why did you choose to go with the neww coordinate? I don't see them mentioned anywhere in the documentation, and I have no idea of what the difference is (if there is one) between the coordinates.

Switching to the new, undocumented coordinates would cause the problem you're experciencing now to all the people still using the "old", documented coordinates, so I don't think I will make the change anyway.

Hey, I can try to explain a little, but it might be better to contact the mockk maintainers to fully understand what (and why) they did...

As far as I understood, they introduced a new Kotlin multiplatform setup (cf. https://kotlinlang.org/docs/multiplatform-get-started.html) with 1.12.6. That seems to be backwards compatible for Gradle users, but Maven apparently cannot handle it properly, that's why Maven users now need to use io.mockk:mockk-jvm coordinates instead of mockk.

After switching the coordinates I ran into issues that could be solved by excluding io.mockk:mockk from the springmockk dependency, because springmockk contains an older version (1.12.4 in my case).

aSemy commented

An upcoming release of MockK will contain fixes so using mockk-jvm will no longer be necessary when using Maven

mockk/mockk#905

UPDATE: I was mistaken - if you use Maven, you must use io.mockk:mockk-jvm. Gradle can continue to use io.mockk:mockk

That's good news @aSemy ! Thanks for the feedback.

MocKK v1.12.8 has just been released.

Alas, the issue is not yet resolved, as 1.12.8 still requires mockk-jvm as a dependency ๐Ÿ˜”