0

我在编译在这里找到的 Jung 的番石榴分支时遇到问题。jung-visualization 的 PluggableRenderContext.java 有一个编译错误。看来这个问题之前已经出现过这个谷歌搜索可见,但链接重定向到 jung GitHub 存储库。

我已将 GitHub 存储库克隆到本地计算机,然后将 Maven 项目导入 eclipse。当以“全新安装”为目标运行时,我在构建 jung-visualization 时得到以下输出。


[INFO] ------------------------------------------------------------------------
[INFO] Building jung-visualization 2.0.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jung-visualization ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jung-visualization ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/eric/Documents/Development/java/git/jung/jung/jung-visualization/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0:compile (default-compile) @ jung-visualization ---
Compiling 158 source files to /Users/eric/Documents/Development/java/git/jung/jung/jung-visualization/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] jung2 .............................................. SUCCESS [  0.570 s]
[INFO] jung-api ........................................... SUCCESS [  2.159 s]
[INFO] jung-graph-impl .................................... SUCCESS [  2.148 s]
[INFO] jung-algorithms .................................... SUCCESS [  4.028 s]
[INFO] jung-io ............................................ SUCCESS [  3.369 s]
[INFO] jung-visualization ................................. FAILURE [  1.770 s]
[INFO] jung-samples ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.192 s
[INFO] Finished at: 2015-08-16T23:59:57-04:00
[INFO] Final Memory: 62M/369M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0:compile (default-compile) on project jung-visualization: Compilation failure: Compilation failure:
[ERROR] /Users/eric/Documents/Development/java/git/jung/jung/jung-visualization/src/main/java/edu/uci/ics/jung/visualization/PluggableRenderContext.java:[47,7] error: PluggableRenderContext is not abstract and does not override abstract method getEdgeShapeTransformer() in RenderContext
[ERROR] 
[ERROR] could not parse error message:   where V,E are type-variables:
[ERROR] V extends Object declared in class PluggableRenderContext
[ERROR] E extends Object declared in class PluggableRenderContext
[ERROR] /Users/eric/Documents/Development/java/git/jung/jung/jung-visualization/src/main/java/edu/uci/ics/jung/visualization/PluggableRenderContext.java:310: error: getEdgeShapeTransformer() in PluggableRenderContext cannot implement getEdgeShapeTransformer() in RenderContext
[ERROR] public Function<? super Context<Graph<V,E>,E>,Shape> getEdgeShapeTransformer() {
[ERROR] ^
[ERROR] -> [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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :jung-visualization

任何帮助,将不胜感激!最好的问候,MCG。

4

1 回答 1

0

看起来 Guava-fied RenderContext.java 的声明中有一个错误;而不是这个:

Function<Context<Graph<V,E>,E>,Shape> getEdgeShapeTransformer();

应该是这样的:

Function<? super Context<Graph<V,E>,E>,Shape> getEdgeShapeTransformer();

以便签名兼容。

于 2015-08-17T23:14:30.557 回答