Details
-
Question
-
Status: Resolved
-
Major
-
Resolution: Information Provided
-
4.1.7, 4.2.6
-
None
-
None
Description
I'm trying to build a custom Karaf distribution based on version 4.2.6. using maven-plugin. I took the example from hereĀ https://github.com/apache/karaf/blob/master/examples/karaf-maven-example/karaf-maven-example-assembly/pom.xml
and added some boot features I need.
Distribution is build by mvn clean install, Maven 3.6.2, Oracle Java 1.8.0_202
My pom.xml is
<?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/xsd/maven-4.0.0.xsd"> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <modelVersion>4.0.0</modelVersion> <groupId>karaf-demo</groupId> <version>0.0.1-SNAPSHOT</version> <artifactId>karaf-assembly-demo</artifactId> <name>Apache Karaf :: Examples :: Maven :: Assembly</name> <packaging>karaf-assembly</packaging> <dependencies> <dependency> <groupId>org.apache.karaf.features</groupId> <artifactId>framework</artifactId> <version>4.2.6</version> <type>kar</type> </dependency> <dependency> <groupId>org.apache.karaf.features</groupId> <artifactId>standard</artifactId> <version>4.2.6</version> <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>4.2.6</version> <extensions>true</extensions> <configuration> <finalName>${project.artifactId}</finalName> <bootFeatures> <feature>standard</feature> <feature>bundle</feature> <feature>config</feature> <feature>diagnostic</feature> <feature>feature</feature> <feature>shell</feature> <feature>log</feature> <feature>management</feature> <feature>package</feature> <feature>shell-compat</feature> <feature>ssh</feature> <feature>system</feature> <feature>wrap</feature> <feature>http-whiteboard</feature> <feature>deployer</feature> <feature>service</feature> <feature>kar</feature> <feature>scr</feature> <feature>aries-blueprint</feature> <feature>eventadmin</feature> </bootFeatures> <archiveZip>false</archiveZip> </configuration> </plugin> </plugins> </build> </project>
This works fine as long as I don't include eventadmin. If it is included running the dist by target/assembly/bin/karaf clean results in
org.apache.karaf.features.core[org.apache.karaf.features.internal.service.FeaturesServiceImpl] : Unknown protocol: mvn java.net.MalformedURLException: Unknown protocol: mvn at java.net.URL.<init>(URL.java:627) at java.net.URL.<init>(URL.java:490) at java.net.URL.<init>(URL.java:439) at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installConfigurationFile(FeatureConfigInstaller.java:268) at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installFeatureConfigs(FeatureConfigInstaller.java:155) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.installConfigs(BundleInstallSupportImpl.java:301) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installConfigs(FeaturesServiceImpl.java:1178) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:955) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Unknown protocol: mvn at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373) at java.net.URL.<init>(URL.java:622) ... 13 more org.apache.karaf.features.core[org.apache.karaf.features.internal.service.BootFeaturesInstaller] : Error installing boot features java.net.MalformedURLException: Unknown protocol: mvn at java.net.URL.<init>(URL.java:627) at java.net.URL.<init>(URL.java:490) at java.net.URL.<init>(URL.java:439) at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installConfigurationFile(FeatureConfigInstaller.java:268) at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installFeatureConfigs(FeatureConfigInstaller.java:155) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.installConfigs(BundleInstallSupportImpl.java:301) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installConfigs(FeaturesServiceImpl.java:1178) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:955) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Unknown protocol: mvn at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373) at java.net.URL.<init>(URL.java:622) ... 13 more
I guess I miss a dependent feature or bundle. For version 4.0.10 including eventadmin works.