【问题标题】:How to test if a feature is installed in a karaf console script?如何测试一个功能是否安装在 karaf 控制台脚本中?
【发布时间】:2015-08-18 15:01:37
【问题描述】:

我需要编写一个卸载功能的 karaf 控制台脚本,如果它存在于 karaf 3.0.4 上。

到目前为止,我还没有在文档 (https://karaf.apache.org/manual/latest-3.0.x/developers-guide/scripting.html) 中找到任何直接引用提及。使用shell:env ? 总是返回null 作为值,我不确定? 是否是karaf 中支持的环境变量名称。

那么如果存在某个功能,如何执行 karaf 命令?

【问题讨论】:

    标签: scripting console osgi karaf


    【解决方案1】:

    无法测试 3.0.4 版本的 karaf 控制台脚本中是否安装了功能。这是因为commands for scope feature 不会向控制台返回任何内容(请参阅source code)。

    解决方法是将deploy another command 发送给 karaf,后者将布尔值返回到控制台并在脚本中使用它。

    【讨论】:

      猜你喜欢
      • 2013-11-22
      • 2013-07-15
      • 2016-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多