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
Bug: MockK cannot be used in a project with module-info.java #296
Comments
Thank you |
You're welcome. As a workaround I will run my tests on classpath instead of modulepath. |
Do you plan to fix this? |
I plan to fix if it is possible not to change public interface, but currently on my main workplace there is a lot of work, so it will happen not now. I dont want to promise anything. My hope as well that some contributors will finally appear while I am not doing this maintenance job. |
OK, thanks for the information |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as |
Any news here? |
I just hit this as well. Should this issue be reopened? |
Still relevant and problematic for Java modules adoption. |
io.mockk:mockk - Any update on this fix? |
Prerequisites
Expected Behavior
Mockk should work when using Java 9 modules
Current Behavior
The java compiler fails (see error message below)
Failure Information (for bugs)
The reason why it does not work is that there are two artifacts (mockk-1.9.3.jar and mockk-dsl-jvm-1.9.3.jar) that have classes in the same package (io.mockk).
The java platform module system (JPMS) creates two automatic modules from these jars (named mockk and mockk-dsl-jvm). The problem is that the JPMS does not allow two modules to export the same package.
Putting the classes in different packages would solve this issue.
Mind there may be more jars (like mockk-common) that have classes in this package.
Steps to Reproduce
Context
Failure Logs
java.lang.module.ResolutionException: Modules mockk and mockk.dsl.jvm export package io.mockk to module kotlin.stdlib.common
java.lang.module.ResolutionException: Modules mockk.dsl.jvm and mockk export package io.mockk to module org.junit.jupiter.engine
The text was updated successfully, but these errors were encountered: