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

JPMS issue with Moshi 1.15.0 #1710

Open
pemistahl opened this issue Jul 21, 2023 · 4 comments
Open

JPMS issue with Moshi 1.15.0 #1710

pemistahl opened this issue Jul 21, 2023 · 4 comments

Comments

@pemistahl
Copy link

I'm the author of a modularized library written in Kotlin. I use the following artifacts as dependencies for my library:

  • com.squareup.moshi:moshi
  • com.squareup.moshi:moshi-kotlin

While trying to update Moshi from 1.14.0 to 1.15.0, I add the following lines to my library's module-info.java, according to the module names that have been introduced in 1.15.0, probably as the result of request #1579:

requires com.squareup.moshi;
requires com.squareup.moshi.kotlin;

However, module resolution fails with the following exception:

Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules com.squareup.moshi and com.squareup.moshi.kotlin export package com.squareup.moshi to module okio

You have created split packages here which is not allowed in the Java module system. A module is not allowed to read the same package from two different modules. Can you please fix this? Until then, I stay with Moshi 1.14.0. Thank you.

@pemistahl pemistahl added the bug label Jul 21, 2023
@black2unicorn
Copy link

enough is enough

@pemistahl
Copy link
Author

@black2unicorn How am I supposed to interpret your comment?

@ZacSweers
Copy link
Collaborator

Can you paste the full trace? You've truncated it to the point where it's a little vague. A reproducible sample would be helpful

@pemistahl
Copy link
Author

Sorry for the late response. There is no stacktrace. The Java compiler just returns the error mentioned above. Additionally, it just returns the following:

error: module com.github.pemistahl.lingua reads package com.squareup.moshi from both com.squareup.moshi and com.squareup.moshi.kotlin

As I said previously, a Java module is not allowed to read the same package from two different modules. So you need to use different packages in both artifacts so that the Java module system works properly.

Anyway, I will most probably exchange Moshi with another library which is more reliable and contains fewer bugs. Please just keep this problem in mind. Thank you.

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

No branches or pull requests

3 participants