如何将新功能添加到 ODL Oxygen SR3 (0.8.3) 作为 Karaf 模块?
例如,我从以下位置下载了预构建的 ODL:官方网站 https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/karaf/0.8.3/karaf-0.8.3.tar.gz。然后我想做烤面包机样品 https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Toaster_Step-By-Step作为 Oxygen 的新模块,它是使用命令创建的:
wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.archetypes -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeCatalog=remote -DarchetypeVersion=1.1.0-SNAPSHOT
编译后,它会生成构建文件到本地maven存储库(~/.m2/repository/com/example/toaster
)。我复制了com/example/toaster
到 Karaf 默认存储库文件夹./karaf-0.8.3/system
。然后我想将其提供给feature:list
所以我可以安装feature:install toaster
。首先我需要将其添加到存储库列表中:
./karaf-0.8.3/bin/karaf
feature:repo-add mvn:com.example.toaster/features-toaster
不幸的是它显示了一个错误:
执行命令时出错:解析工件 com.example.toaster:features-toaster:jar:0.1.0-SNAPSHOT 时出错:
[在 opendaylight-snapshot 中找不到工件 com.example.toaster:features-toaster:jar:0.1.0-SNAPSHOT (https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/)] https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/)%5D: mvn:com.example.toaster/features-toaster
上述命令基于这个帖子 https://ask.opendaylight.org/question/7896/how-to-use-add-repo/。正确的做法是什么repo-add
?
请阅读https://karaf.apache.org/manual/latest/#_artifacts_repositories_and_urls https://karaf.apache.org/manual/latest/#_artifacts_repositories_and_urls文章。
您需要做的基本上是将包含您的烤面包机的存储库 URl 添加到包中,如下所示:
(上面链接的文档中的示例)
<bundle>http://repo1.maven.org/maven2/org/apache/servicemix/nmr/org.apache.servicemix.nmr.api/1.0.0-m2/org.apache.servicemix.nmr.api-1.0.0-m2.jar</bundle>
还可以使用属性定义存储库:
org.ops4j.pax.url.mvn.repositories :逗号分隔的远程列表
解析时按出现顺序检查的存储库 URL
Maven 工件
Source: https://karaf.apache.org/manual/latest/#_maven_url_handler https://karaf.apache.org/manual/latest/#_maven_url_handler
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)