0
創建自定義karaf分佈如何將包添加到karaf Custom Distribution?
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.me</groupId>
<artifactId>root-karaf</artifactId>
<packaging>karaf-assembly</packaging>
<name>${project.artifactId}</name>
<version>4.0.4</version>
<dependencies>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>framework</artifactId>
<version>4.0.4</version>
<type>kar</type>
</dependency>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>standard</artifactId>
<version>4.0.4</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>4.0.4</version>
<extensions>true</extensions>
<configuration>
<!-- no startupFeatures -->
<startupFeatures>
</startupFeatures>
<installedFeatures>
</installedFeatures>
<bootFeatures>
<feature>standard</feature>
<feature>eventadmin</feature>
<feature>scr</feature>
</bootFeatures>
<excludedArtifactIds>
<artifactId>slf4j-api</artifactId>
</excludedArtifactIds>
</configuration>
</plugin>
</plugins>
</build>
</project>
現在我想創建例如捆綁,並加入到這個分配或例如補充一點:<bundle>wrap:mvn:com.google.code.gson/gson/2.8.0</bundle>
TI rhis分佈。我thried這樣的:
<bootFeatures>
<feature>standard</feature>
<feature>eventadmin</feature>
<feature>scr</feature>
<bundle>wrap:mvn:com.google.code.gson/gson/2.8.0</bundle>
</bootFeatures>
但尼特工作
我feature.xml中創建並投入資源
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="platform-features"
xmlns="http://karaf.apache.org/xmlns/features/v1.0.0"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.0.0 http://karaf.apache.org/xmlns/features/v1.0.0">
<feature name="platform" version="${project.version}" install="auto">
<details>Service Platform</details>
<feature>test</feature>
</feature>
<feature name="test" version="4.0.4" install="auto">
<bundle>mvn:com.google.code.gson/gson/2.8.0</bundle>
</feature>
</features>
謝謝你kep!我創建了futures.xml。我把它放在哪裏(文件本身),以及如何連接和配置它,以便從這種未來的捆綁包進入程序集? – user5620472
使用您的功能創建另一個模塊,將它作爲依賴項添加到您的依賴項列表中,將該功能的名稱添加到bootfeatures列表中,然後設置 –