我想使用较新版本的 l2switch 插件,但是当我尝试编译项目时出现以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project loopremover-impl: Compilation failure: Compilation failure:
[ERROR] /C:/Users/kevin/git/l2switch/loopremover/implementation/src/main/java/org/opendaylight/l2switch/loopremover/topology/TopologyLinkDataChangeHandler.java:[283,41] cannot find symbol
[ERROR] symbol: method getAugmentation(java.lang.Class<org.opendaylight.yang.gen.v1.urn.opendaylight.l2switch.loopremover.rev140714.StpStatusAwareNodeConnector>)
[ERROR] location: variable nc of type org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector
[ERROR] /C:/Users/kevin/git/l2switch/loopremover/implementation/src/main/java/org/opendaylight/l2switch/loopremover/flow/InitialFlowWriter.java:[248,21] cannot find symbol
[ERROR] symbol: method setKey(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey)
[ERROR] location: class org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder
[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 :loopremover-impl
我认为问题不在我的 .m2 文件夹中,因为我能够正确编译 Openflowplugin 项目。另外我使用的是java 8.0,我的操作系统是windows 10(我使用的是maven插件通过提示编译) 我用来编译的命令是 mvn clean install -U -DskipTests
ps: 我没有编辑l2switch 项目的任何代码,我只是从github 存储库导入master 分支并尝试编译
最佳答案
l2switch 目前没有任何人维护,因此没有参与氟释放周期。它需要版本升级和代码更改以符合 yangtools、mdsal 等上游的更改。对于上述编译错误,getAugmentation 现在是 augmentation 和 setKey 现在是关键。这些上游变化是在 Fluorine 和其他方面进行的。在 Fluorine 发布周期中,所有这些都记录在 ODL 邮件列表和 TSC JIRA 项目中。 ODL 社区欢迎任何重启项目、重新构建和维护项目的贡献。
关于java - 编译最新版l2switch时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53109420/