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

Upgrade to mockk 1.12.7 #86

Closed
stefanzilske opened this issue Aug 26, 2022 · 6 comments
Closed

Upgrade to mockk 1.12.7 #86

stefanzilske opened this issue Aug 26, 2022 · 6 comments

Comments

@stefanzilske
Copy link

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.

@jnizet
Copy link
Member

jnizet commented Aug 28, 2022

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.

@stefanzilske
Copy link
Author

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
Copy link

aSemy commented Aug 29, 2022

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

@jnizet
Copy link
Member

jnizet commented Aug 30, 2022

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

@jnizet jnizet closed this as completed Aug 30, 2022
@jnizet jnizet closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2022
@ghost
Copy link

ghost commented Sep 15, 2022

MocKK v1.12.8 has just been released.

@stefanzilske
Copy link
Author

Alas, the issue is not yet resolved, as 1.12.8 still requires mockk-jvm as a dependency 😔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants