Java module split package conflict
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?
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)?
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-moduleis 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 primusand none of the other JARs - use
--path-module primus=path/to/jarfor 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...
Great thanks @nicolaiparlog !
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.
We may need to bring cyclops 11 forward in time to this year, if there is a community demand for this.