【问题标题】:Failed to add new feature to OpenDayLight未能向 OpenDayLight 添加新功能
【发布时间】:2018-09-20 08:42:41
【问题描述】:

我尝试将toaster example(稍作修改)添加到ODL发行版,但无法从本地maven repo安装,它说无法执行加载命令。

重现步骤:

  1. 下载并安装烤面包机示例。

    git clone -b stable/oxygen https://github.com/opendaylight/controller.git
    cd ./controller/opendaylight/md-sal/samples
    mvn clean install -DskipTests -Dcheckstyle.skip
    
  2. DownloadOpenDayLight Oxygen-SR3,然后编辑一些配置:

  3. 在 org.ops4j.pax.url.mvn.cfg 中附加本地 maven 存储库

    org.ops4j.pax.url.mvn.defaultRepositories =
        [...],\
        file:${user.home}/.m2/repository@id=local-repo@snapshots
    
  4. 将烤面包机提供者和消费者添加到功能 63b7c6a7-e4db-407d-84a0-4fa24f1ae888

    <!-- I changed the default 1.7.4-SNAPSHOT version to 10.0.0-SNAPSHOT for comprehension -->
    <bundle>mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT</bundle>
    <bundle>mvn:org.opendaylight.controller.samples/sample-toaster-consumer/10.0.0-SNAPSHOT</bundle>
    
  5. 运行 karaf 以确保已安装烤面包机。不幸的是,它们无处可寻,并且在 karaf.log 中没有产生警告或错误

    ./bin/karaf
    feature:list | grep toaster
    
  6. 所以我尝试通过 CLI 添加,但返回错误:

    feature:repo-add mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT
    

    添加功能网址 mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT

    [致命错误] :1:1: prolog 中不允许有内容。

    执行命令时出错:无法加载 mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0.0-SNAPSHOT : mvn:org.opendaylight.controller.samples/sample-toaster-provider/10.0。 0-快照

    http://pasted.co/f5ddf03f 的完整错误

【问题讨论】:

  • 你的本地仓库中有 settings.xml 吗?
  • @tryingToLearn 是的,settings.xml文件是从https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml下载的。

标签: maven apache-karaf sdn opendaylight


【解决方案1】:

您应该安装烤面包机功能:

feature:install odl-toaster

而不仅仅是几个单独的烤面包机包。该特性封装了所有的烤面包机包和依赖特性。

【讨论】:

  • 这与问题无关。我正在尝试向 ODL 添加任意功能,而不是安装现有功能。
  • 嗯?根据您概述的步骤,您正在尝试在控制器项目中构建和安装现有的烤面包机项目。在第 4 步中,您尝试只安装几个烤面包机捆绑包。但是,还需要安装其他捆绑包和功能。因此,包含所有内容的烤面包机 karaf 功能的原因。因此,您需要确保安装了烤面包机的功能存储库,然后安装 odl-toaster 功能。对于任何任意功能,它都是相似的。有意义吗?
【解决方案2】:

如果这个问题不是关于烤面包机而是一般来说,那么这个问题与OpenDaylight Oxygen Deploy app built from opendaylight-startup-archetype 重复。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2020-11-19
  • 1970-01-01
  • 1970-01-01
  • 2010-09-07
  • 2017-12-06
  • 1970-01-01
  • 1970-01-01
  • 2012-07-22
相关资源
最近更新 更多