I'm trying to use the Karaf maven plugin to build a custom Karaf distribution 
(so "karaf-assembly" packaging type)

I'm stuck on the following error though:

Failed to execute goal 
org.apache.karaf.tooling:karaf-maven-plugin:4.1.1:assembly (default-assembly) 
on project karaf-distro: Unable to build assembly: Unable to resolve root: 
missing requirement [root] osgi.identity; osgi.identity=core-features; 
type=karaf.feature; version=1.0.0.SNAPSHOT; 
filter:="(&(osgi.identity=core-features)(type=karaf.feature)(version>=1.0.0.SNAPSHOT))"
 [caused by: Unable to resolve core-features/1.0.0.SNAPSHOT: missing 
requirement [core-features/1.0.0.SNAPSHOT] osgi.identity; 
osgi.identity=mybundle; type=osgi.bundle; 
version="[1.0.0.201706120848,1.0.0.201706120848]"; resolution:=mandatory 
[caused by: Unable to resolve mybundle/1.0.0.201706120848: missing requirement 
[mybundle/1.0.0.201706120848] osgi.contract; osgi.contract=JavaServlet; 
filter:="(&(osgi.contract=JavaServlet)(version=3.1.0))"]]



I have the org.apache.karaf.features:enterprise feature as a dependency (along 
with framework, standard, spring), so I believe that it should have the 3.1.0 
servlet API, so I don't think it's an issue of requiring 3.1.0 when something 
earlier is installed.

In development we use felix HTTP (we use bndtools, and that's just what it 
uses), and the requirement is satisfied by the Apache Felix Servlet API bundle. 
But Karaf uses pax-web instead, and nothing seems to provide that capability as 
far as I can tell (looking at output of bundle:headers in the console).

Naively adding a maven dependency on org.apache.felix.http.servlet-api give me 
a different, earlier, error 

    Unable to build assembly: [wrap/0.0.0]

My bundle is built using bndtools, I'm afraid I don't know at the moment how 
that manifest requirement comes about, haven't managed to follow the whole 
chain through yet.

So my question is, within Karaf, where do I get this dependency satisfied? 
Can I easily just substitute felix HTTP in place of pax-web on the basis that 
that's what we use in production? If so how? Naively adding felix HTTP as 
dependencies in my pom.xml just gives this "wrap/0.0.0" error, which means 
nothing to me.

Thanks.

Reply via email to