jung icon indicating copy to clipboard operation
jung copied to clipboard

Split package in jung-api, jung-graph-impl and demos/samples packages

Open philippecade opened this issue 5 years ago • 4 comments

Split packages are not allowed from Java 9 anymore. The jsplitpkgscan tool can be used to find split packages.

When executing jsplitpkgscan tool on all the JAR files published on Maven, we get the following result:

digraph "summary" {
   "file:/jung-api-2.1.1.jar"                         -> "edu.uci.ics.jung.graph";
   "file:/jung-graph-impl-2.1.1.jar"                  -> "edu.uci.ics.jung.graph";
   "file:/jung-api-2.1.1.jar"                         -> "edu.uci.ics.jung.graph.util";
   "file:/jung-graph-impl-2.1.1.jar"                  -> "edu.uci.ics.jung.graph.util";
   "file:/jung-3d-demos-2.0.1.jar"                    -> "edu.uci.ics.jung.samples";
   "file:/jung-jai-samples-2.0.1.jar"                 -> "edu.uci.ics.jung.samples";
   "file:/jung-samples-2.1.1.jar"                     -> "edu.uci.ics.jung.samples";
}

The edu.uci.ics.jung.graph and edu.uci.ics.jung.graph.util packages exist both in the jung-api and in the jung-graph-impl JAR files.

philippecade avatar Jun 26 '19 13:06 philippecade

with version 3.0, this is already reduced:

digraph "summary" {
   "file:/jung-api-3.0-SNAPSHOT.jar"                  -> "edu.uci.ics.jung.graph.util";
   "file:/jung-graph-impl-3.0-SNAPSHOT.jar"           -> "edu.uci.ics.jung.graph.util";
}

philippecade avatar Jun 26 '19 14:06 philippecade

Thanks for the note; I wasn't aware of this issue. The way that we're likely going to resolve this in 3.0 is to get rid of the graph-impl jar entirely; almost all of the implementation has been delegated to Guava's common.graph, and the rest can just go in the jung-api jar.

As for 2.x, we don't currently have plans to release another version.

jrtom avatar Aug 25 '19 03:08 jrtom

Hi, I am having the following problem: [ERROR] module X reads package edu.uci.ics.jung.graph from both jung.graph.impl and jung.api I do this because in my module-info.java I have both

requires jung.api;
requires jung.graph.impl;

Ive googled for this error and arrived at this issue. I am using version 2.1.1 of your lib and I understand from your conversation that this will not be fixed, so my only option left seems to either

  1. Use version 3.0 as you said above
  2. Kindly ask if you can update version 2.x (you said its not planned, but maybe I have luck :))
  3. Fix this problem somehow by changing some settings in my maven/java setup
  4. Any other option you might recommend

For option 1), I didnt find where to download it. Is there a link you can provide? If option 2) is not realistic for you, could you give me a tip of what to do as suggested in 3) or 4)?

I'm really lost, so any help would be welcome :)

Thank you so much!

gustavonmartins avatar Apr 21 '22 14:04 gustavonmartins

I also have this issue. I would like to use JUNG for a fairly trivial use case in a modern java app but the module system prevents me from using it because of two JAR files both exporting the same package I see the original post was from 3 years ago, is version 3.0 likely to be around any time soon, or is this project effectively dead?

@namoscagnm PS: one option is to turn the JARs you want to use into a single mega-jar. Unpack them all into the same directory and zip them back up into a single jung-combined-2.1.1.jar file. that then becomes a single unnamed module and so Java is happier. It's a bit of a nuisance tho and stops you using package managers :(

stikdragon avatar Dec 17 '22 19:12 stikdragon