如何在 ODL 开发的应用程序中添加内置功能?

How to add built in features in an ODL developed application?

为了创建一个ODL应用程序,我已经使用maven构建了应用程序框架如下:

mvn archetype:generate -DarchetypeGroupId= org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=http://nexus.opendaylight.org/content/repositories/opendaylight.release/ -DarchetypeCatalog=remote -DarchetypeVersion=1.3.0-Carbon

我很困惑我应该在 "DarchetypeVersion=1.3.0-Carbon" 中使用哪个版本?我在哪里可以找到要使用的所有可用版本?

我打算使用一些默认情况下不存在的功能,我知道任何附加功能,如 l2switching 或 openflowplugin,都是通过编辑 feature.xml[=30= 添加的] 和 pom.xml 文件。我仍然对使用不同的版本感到困惑。如何在我的 pox.xml 文件中指定版本?

我正在通过添加更多存储库行来编辑 feature.xml 文件,如下所示:

< repository > mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features < /repository>
< repository > mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.dluxapps/features-dluxapps/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.openflowplugin/features-openflowplugin/{{VERSION}}/xml/features < /repository >
< repository > mvn:org.opendaylight.l2switch/features-l2switch/{{VERSION}}/xml/features < /repository >

在pom.xml文件中,看起来我需要添加一些依赖标签,但我仍然不知道要使用什么版本:

<dependency >
    < groupId > org.opendaylight.l2switch < /groupId >
    < artifactId > features-l2switch< /artifactId >
    < classifier >features < /classifier >
    < type > xml < /type >
    < version > ${l2switch.version} < /version >
    < scope > runtime < /scope >
< /dependency >

例如 lists the version numbers you can use for the opendaylight-startup-archetype. You can indeed also just check the repository, but the correct link to see all versions of that archetype would be https://nexus.opendaylight.org/#nexus-search;quick~opendaylight-startup-archetype(不是 yangtools-artifacts)。

至于混乱。 feature.xml 和 pom.xml 文件中的版本,最好是查看原型示例项目,或者通过查看 OpenDaylight 源代码中的相应分支找到正确的版本。例如,如果您想知道 ODL 的 Carbon 版本的 say l2switch 的修正版本是什么,您可以查看例如https://github.com/opendaylight/l2switch/blob/stable/carbon/artifacts/pom.xml 找到 0.5.3-SNAPSHOT(或使用 0.5.2)。

仅供参考:据我所知,氮气释放的原型在撰写本文时已被破坏;所以我只想使用最新的前沿氧气,用于原型和项目,如 l2switch 或任何你感兴趣的东西。