在没有karaf控制台的pom.xml中安装org.json

问题描述 投票:0回答:1

我在我的servicemix项目中需要org.json依赖项。此依赖项尚不存在,因此我需要导入并安装它。

所以这就是我添加依赖项的方式:

    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20170516</version>
    </dependency>

我可以使用以下方法在karaf中安装它:

install wrap:mvn:org.json/json/20170516

但是我想通过我的pom.xml或feature.xml安装它,因此我不必在每次构建Servicemix服务器时都安装它。

json maven apache-karaf
1个回答
0
投票

您始终可以创建自定义功能文件。 ref

<features name="Features(JSON)">
    <feature name="org.json" version="20170516" description="JSON Library">
        <bundle start="true" start-level="80">mvn:org.json/json/20170516</bundle>
    </feature>
</features>

并使用命令将其添加到karaf中>>

feature:repo-add
© www.soinside.com 2019 - 2024. All rights reserved.