Closed songjinghe closed 2 years ago
Hi, this might work, try to set your dependency like this:
<dependency>
<groupId>org.gephi</groupId>
<artifactId>core-library-wrapper</artifactId>
<exclusions>
<exclusion>
<groupId>om.google.collections</groupId>
<artifactId>google-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
@eduramiba thanks, I've tried it, but it doesn't work. I think it's because core-library is a vitual package ( it doesn't appear in the finally generated nbm file, here's part of maven package output)
[INFO] --- nbm-maven-plugin:3.14:manifest (default-manifest) @ gephi-plugin-tgraph-demo ---
[INFO] NBM Plugin generates manifest
[INFO] Adding on module's Class-Path:
[INFO] org.act:neo4j-temporal-demo:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-kernel:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-primitive-collections:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-unsafe:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-io:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-csv:jar:2.2.3-SNAPSHOT
[INFO] org.act:temporal-graph:jar:0.2.1-SNAPSHOT
[INFO] com.google.guava:guava:jar:18.0
[INFO] org.neo4j:neo4j-lucene-index:jar:2.2.3-SNAPSHOT
[INFO] org.apache.lucene:lucene-core:jar:3.6.2
[INFO] org.neo4j:neo4j-graphviz:jar:2.2.3-SNAPSHOT
[INFO] org.slf4j:slf4j-log4j12:jar:1.7.9
[INFO] org.slf4j:slf4j-api:jar:1.7.9
[INFO] log4j:log4j:jar:1.2.17
[INFO]
and I think core-library-wrapper
provider access to google-collections
through netbeans module mechanism at runtime. I wonder the only way to avoid this is to NOT include core-library-wrapper
? However, if I do not include core-library-wrapper
as dependency, it throw an error when package:
[INFO] --- nbm-maven-plugin:3.14:manifest (default-manifest) @ gephi-plugin-tgraph-demo ---
[INFO] NBM Plugin generates manifest
[INFO] Adding on module's Class-Path:
[INFO] org.act:neo4j-temporal-demo:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-kernel:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-primitive-collections:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-unsafe:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-io:jar:2.2.3-SNAPSHOT
[INFO] org.neo4j:neo4j-csv:jar:2.2.3-SNAPSHOT
[INFO] org.act:temporal-graph:jar:0.2.1-SNAPSHOT
[INFO] org.neo4j:neo4j-lucene-index:jar:2.2.3-SNAPSHOT
[INFO] org.apache.lucene:lucene-core:jar:3.6.2
[INFO] org.neo4j:neo4j-graphviz:jar:2.2.3-SNAPSHOT
[INFO] org.slf4j:slf4j-log4j12:jar:1.7.9
[INFO] org.slf4j:slf4j-api:jar:1.7.9
[INFO] log4j:log4j:jar:1.2.17
[INFO] com.google.guava:guava:jar:18.0
[ERROR] Project uses classes from transitive module org.gephi:core-library-wrapper:jar:0.9.1 which will not be accessible at runtime.
[INFO] To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the useOSGiDependencies=false parameter
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] TGraph Demo ........................................ FAILURE [ 4.897 s]
[INFO] gephi-plugins ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.409 s
[INFO] Finished at: 2016-05-29T21:15:57+08:00
[INFO] Final Memory: 30M/441M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.14:manifest (default-manifest) on project gephi-plugin-tgraph-demo: See above for failures in runtime NetBeans dependencies verification. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Right, probably one of your dependencies uses something from core library wrapper and you have to include it. We probably should update Gephi to use Guava instead of the old google collections, I think it's not heavily used in Gephi anyway.
My problem disappeared if I modify my code NOT to use classes org.apache.batik.ext.awt.g2d.DefaultGraphics2D
which is provide by core-library-wrapper
(eg. my plugin project don't denpend on core-library-wrapper
any more). Then there's no conflict.
But this problem may still remains for those whose dependencies conflict with core-library-wrapper
.
I think the best way to solve this is to tell netbeans module manager/container's classes loader to first search the module's local dependencies, then classes provided by other modules. Is there any way to do this?
I searched a bit before and I am not sure that is possible unfortunately.
So, there is nothing we can do about it, and I should mark it as CLOSED ?
Maybe we can leave it open so I remember to update google collections to guava.
OK~
Thanks for the report. I (finally) created a ticket in Gephi so we can fix this. I'll close this one as no workaround could be found. There might be a way to hack Netbeans dependencies to do this but probably not from a plugin.
I was developing a preview plugin, my dependencies contains:
but the
org.gephi:core-library-wrapper
reference tocom.google.collections:google-collections:1.0
, while my plugin heavily depend oncom.google.guava:guava:18.0
.guava
can be seen as an new version ofcom.google.collections:google-collections:1.0
because they the same class name and path( say,/com/google/common/base/SomeClassWithSameName
). So when I debug my plugin, it crashs because it seems it is using classes fromgoogle-collections
, notguava
.I wonder if this would be solved, and how? Any tips maught be helpfull.