【问题标题】:Assemble a Karaf container with my dependencies使用我的依赖项组装一个 Karaf 容器
【发布时间】:2019-03-29 10:43:16
【问题描述】:

我能够在一个新模块中组装一个具有标准和 webconsole 功能的 karaf 容器:

<dependencies>
    <dependency>
        <groupId>org.apache.karaf.features</groupId>
        <artifactId>framework</artifactId>
        <type>kar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.karaf.features</groupId>
        <artifactId>standard</artifactId>
        <classifier>features</classifier>
        <type>xml</type>
        <scope>runtime</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.karaf.tooling</groupId>
            <artifactId>karaf-maven-plugin</artifactId>
            <version>${org.apache.karaf.features.framework.version}</version>
            <extensions>true</extensions>
            <configuration>
                <bootFeatures>
                    <feature>standard</feature>
                    <feature>webconsole</feature>
                </bootFeatures>
            </configuration>
        </plugin>
    </plugins>
</build>

现在,我想做更多的事情,我想将我的其他模块/代码添加到这个容器中以一起启动它并测试我的代码、我的 REST 调用等等......

我的一个模块是这样的:

<artifactId>config-testutils</artifactId>

<properties>
    <bundle.symbolicName>${project.groupId}.${project.artifactId}</bundle.symbolicName>
    <bundle.namespace>${project.groupId}.${project.artifactId}</bundle.namespace>
</properties>

<name>${project.groupId}.${project.artifactId}</name>

<packaging>jar</packaging>

如何添加这些模块以查看它们在我正在组装的这个 Karaf 中是否正常工作?除了手动放入部署文件夹之外,还有其他方法吗?

【问题讨论】:

    标签: maven osgi karaf


    【解决方案1】:

    您应该创建一个包含您自己的捆绑包的功能并将其添加到&lt;bootFeatures&gt;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-24
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 2016-09-10
      • 1970-01-01
      • 2019-04-29
      相关资源
      最近更新 更多