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

Library cannot be used with Java Modules #286

Open
cowwoc opened this issue Jul 17, 2019 · 4 comments
Open

Library cannot be used with Java Modules #286

cowwoc opened this issue Jul 17, 2019 · 4 comments

Comments

@cowwoc
Copy link

cowwoc commented Jul 17, 2019

This library cannot be used with Java Modules because it exports the same package from multiple JAR files.

  • Java Modules does not allow a module to import the same package from two different dependencies.
  • Both uk.co.real-logic:artio-core:0.31 and uk.co.real-logic:artio-codecs:0.31 export package uk.co.real_logic.artio
  • uk.co.real-logic:artio-core:0.31 depends on uk.co.real-logic:artio-codecs:0.31 so one cannot import uk.co.real-logic:artio-core:0.31

Proposed fix: Move the classes into different package so that each JAR exports a unique package name.

@cowwoc cowwoc changed the title Support Java Modules Library cannot be used with Java Modules Jul 17, 2019
@RichardWarburton
Copy link
Contributor

Any thoughts on how to do this in a backwards compatible way? It's not essential to maintain compatibility, but if it is possible then it would be good to do so.

@cowwoc
Copy link
Author

cowwoc commented Jul 18, 2019

Hi Richard,

You could release separate artifacts for Java9+ like guava originally did (they did it for Java8 support) and eventually turn that into the default in the next major release. With that approach you'd need to break compatibility eventually.

Another thing you could do is merge the JAR files so there is only one exporting the package and the other is empty.

Maybe someone has a third idea :)

In our own product, we opted to just break compatibility.

@cowwoc
Copy link
Author

cowwoc commented Sep 17, 2019

Hey @RichardWarburton,

Did you decide how to proceed?

@RichardWarburton
Copy link
Contributor

This was perceived to be a low priority item by clients so I've not progressed it.

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

2 participants