gephi-toolkit sbt build fails
When trying to add a gephi-toolkit dependency from sbt; I get unresolved dependencies errors. Could you please advice on the ways of fixing it.
Here is a mock build.sbt
executed with sbt compile
name := "test"
organization := "test"
version := "0.1-SNAPSHOT"
scalaVersion := "2.11.7"
libraryDependencies += "org.gephi" % "gephi-toolkit" % "0.9.1"
resolvers += Resolver.sonatypeRepo("public")
Here is the resulting error:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.netbeans.modules#org-netbeans-modules-masterfs;RELEASE81: not found
[warn] :: org.netbeans.modules#org-netbeans-core-startup;RELEASE81: not found
[warn] :: org.netbeans.modules#org-netbeans-core;RELEASE81: not found
[warn] :: org.netbeans.api#org-openide-util-lookup;RELEASE81: not found
[warn] :: org.netbeans.api#org-openide-util;RELEASE81: not found
[warn] :: org.netbeans.api#org-openide-filesystems;RELEASE81: not found
[warn] :: net.java.dev#stax-utils;snapshot-20100402: not found
[warn] :: gnu.trove#trove;2.1.0: not found
[warn] :: org.netbeans.api#org-openide-util-ui;RELEASE81: not found
[warn] :: org.netbeans.api#org-openide-dialogs;RELEASE81: not found
[warn] :: org.netbeans.api#org-openide-nodes;RELEASE81: not found
[warn] :: org.netbeans.api#org-netbeans-api-annotations-common;RELEASE81: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
The netbeans dependencies are resolved using the following resolver:
"netbeans repository" at "http://bits.netbeans.org/nexus/content/groups/netbeans/"
Unfortunately the other two I was not able to work out. The jars appear to be available here, but I wasn't even able to get it to work by putting them in my /lib directory.
Stax-utils: https://java.net/projects/stax-utils/downloads/directory/Latest
Gnu Trove (old version 2.1.0) https://sourceforge.net/projects/trove4j/files/trove/2.1.0/
I struggled with this too. In the end I had to just manually put the whole gephi-toolkit-0.9.1-all.jar into my /lib directory and not have any managed dependencies in my build.sbt
I've ended up making a "wrapper" sbt package for it.
On Tue, Jun 21, 2016 at 8:49 AM, Wai-chuen [email protected] wrote:
I struggled with this too. In the end I had to just manually put the whole gephi-toolkit-0.9.1-all.jar into my /lib directory and not have any managed dependencies in my build.sbt
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gephi/gephi-toolkit/issues/16#issuecomment-227303192, or mute the thread https://github.com/notifications/unsubscribe/AAwdkoD2ruDOfO-SEslA_aU8ysm3c1mvks5qNybzgaJpZM4Hvsch .
This issue still exists and prevents me from using the toolkit in my project. I tried putting the JAR in my "lib/" folder directly but this produces weird errors related to Guice whenever I start the application that uses Gephi. It's really a shame, because Gephi is the only Java/Scala library which provides that many Graph algorithm (for centralities and community detection, among others). Any solution?
neil-rubens, any chance you can explain how you made it work?
We just created our own maven repository (actually just a directory on an aws server with the maven directory structure) and put the jar file downloaded from here in there under a different version tag, like "0.9.1-ourco"
Then we just use an sftp resolver in sbt to get it
Ok thanks. I don't think it will resolve my issue though, because just putting the jar in the "lib/" folder prevents my Play Framework 2 app from launching with a weird error
The error goes away as soon as I remove the JAR from "lib/", even though my code doesn't even reference Gephi.
There might be problems with duplicated classes in your classpath or something. The toolkit packages several third party dependencies in one big jar for easy use, but you still can depend on the exact modules from Gephi that you need. They are in maven central.
Check the pom used to build the toolkit: https://github.com/gephi/gephi-toolkit/blob/3335d570a6c55c7be251a1891373238e21a8a6af/pom.xml
Maybe we should repackage all dependencies to something like org.gephi.thirdparty to avoid problems, with https://sonatype.github.io/jarjar-maven-plugin
@frobinet I had to manually repackage a new .jar without the conflicting dependencies (https://drive.google.com/file/d/0B3jMBP69IYDMc1QzSUlDQUVoZVU/view?usp=sharing). The conflicts will probably be different for your project, so you might have to unpack the original .jar and repack it yourself to suit.
Following a reply on a thread I opened on StackOverflow, I managed to get sbt to work by adding the following resolvers:
resolvers ++= Seq( "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/", "NetBeans" at "http://bits.netbeans.org/nexus/content/groups/netbeans/", "gephi" at "https://raw.github.com/gephi/gephi/mvn-thirdparty-repo/" )
There's still one problem though: I don't have access to all classes of Gephi, even though I added this line to my build file:
libraryDependencies += "org.gephi" % "gephi-toolkit" % "0.9.1"
For example, the GraphController class is not present in the org.gephi.graph.api package, even though I have access to org.gephi.graph.api.Node and others. Any idea why?
I'm having the same problems as well. The above from frobinet solved it.
About the com.google.common crash in Play, I think latest 0.9.2-snapshot should fix this because we updated our dependencies to guava (we were using google collections, see commit https://github.com/gephi/gephi/commit/0166ac585cebc503489305bbb9f8907b09c9f700).
Can you try, please?
Closing old issue. Netbeans Platform dependencies have been available for a while on Maven central and any version after 0.9.3 should work just fine.
I am using the toolkit in a clojure project via maven dependencies and still get: Error building classpath. Could not find artifact net.java.dev:stax-utils:jar:snapshot-20100402 in central (https://repo1.maven.org/maven2/).... I tried versions 0.10.0 and 0.10.1 . It works when I use a local toolkit jar, but I'd like to publish the repository sometime...
Hi @blnote,
We still have some legacy dependency on our own ad-hoc repository at "https://raw.github.com/gephi/gephi/mvn-thirdparty-repo/". So you would need to add this Maven repository for it to work. In the mid to long term, we don't want any legacy dependencies that aren't on Central but that's not the case right now.
Thanks, adding the repository worked - also many thanks for Gephi in general!
Ah... there is still a problem...when also depending on io-importer-api it can not find the artifact mysql:mysql-connector-java:jar:8.0.31 The internet says it changed its name to mysql-connector-j at some time...any way i could fix this? thanks! https://blogs.oracle.com/mysql/post/mysql-connectorj-has-new-maven-coordinates
Hum, thanks I'll take a look. In the meantime as a workaround you could maybe exclude this dependency, or the db-drivers one.
no problem, i'll just depend the toolkit jar locally for now.