cyclops icon indicating copy to clipboard operation
cyclops copied to clipboard

Java module split package conflict

Open smarijic opened this issue 6 years ago • 5 comments

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?

smarijic avatar Apr 20 '19 00:04 smarijic

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)?

johnmcclean avatar Apr 23 '19 14:04 johnmcclean

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...

nipafx avatar Apr 23 '19 16:04 nipafx

Great thanks @nicolaiparlog !

johnmcclean avatar Apr 24 '19 14:04 johnmcclean

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.

baha2046 avatar Apr 27 '19 20:04 baha2046

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

johnmcclean avatar May 16 '19 12:05 johnmcclean