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

Java module split package conflict #1053

Open
smarijic opened this issue Apr 20, 2019 · 5 comments
Open

Java module split package conflict #1053

smarijic opened this issue Apr 20, 2019 · 5 comments
Milestone

Comments

@smarijic
Copy link

Hi,

I started modularizing a project in which we use cyclops and cyclops-pure extensively. First problem I experienced is that cyclops.data is found in both cyclops and cyclops-pure which results in error "Module XX reads cyclops.data from both cyclops and cyclops-pure".

Do you have any advice on how to resolve this?

@johnmcclean johnmcclean added this to the 11.0.0 milestone Apr 23, 2019
@johnmcclean
Copy link
Member

We can address the split package issue in version 11, by renaming the packages.

@nicolaiparlog do you know away to address a split package issue in non-modularized 3rd party jars? (without having to rely on a code change in the original)?

@nipafx
Copy link

nipafx commented Apr 23, 2019

If the code can't be changed, there are two ways:

  • Put both (!) JARs on the class path. If the code using them is (a) on the class path or (b) a plain JAR on the module path (i.e. an automatic module), that works fine.
  • If that doen's work, the command line option --patch-module is the only thing left.

Re --patch-module, I make the assumption that the splitting JARs are no explicit modules (i.e. have no module-info.class). Then:

  • pick one of the JARs that split packages, let's call it primus (inter pares), and put it on the module path
  • make all explicit modules that depend on any of the splitting JARs requires primus and none of the other JARs
  • use --path-module primus=path/to/jar for each other JAR during compilation and at run time
  • all other splitting JARs should be on neither path (although ending up in the class path won't be a problem)
  • all dependencies of the splitting JARs must be on some path

I hope I didn't miss anything...

@johnmcclean
Copy link
Member

Great thanks @nicolaiparlog !

@baha2046
Copy link

baha2046 commented Apr 27, 2019

Same problem occur here.
if i try to add this to my module-info.java
requires cyclops;
requires cyclops.reactive.collections;

error: both read package cyclops.reactive.

Both module contain a cyclops/reactive but the content is different.

@johnmcclean
Copy link
Member

We may need to bring cyclops 11 forward in time to this year, if there is a community demand for this.

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

4 participants