You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ntle <nt...@castortech.com> on 2019/03/22 18:38:25 UTC

How to install bundles from p2 site

Hello, 

We have quite a number of bundles (>100) that we develop and host on our p2 
site. I'm looking for a way to install them all on karaf. What i have tried 
so far: 

1.used https://github.com/hstaudacher/tycho-karaf-bridge to build a kar file 
from the "plugins" folder of p2 site. This maven plugin didn't play well 
with our manifests. In all of our bundle manifest, we use "x.x.x.qualifier" 
as version. And thus, import-package and require-bundle also use same 
version format. When generating the kar file, the maven plugin replace 
.qualifier to -qualifier and also synthesize groupid but it did not add this 
groupid to the features.xml file. And lastly, when i install the kar file 
even after modifying the qualifier and groupid mentioned above, i got this 
error which i dont know how to solve: "java.io.IOException: Error resolving 
artifact com.castortech.iris.emf.forms:1.0.0.201903161436:jar:[0.0,): [Could 
not find metadata 
com.castortech.iris.emf.forms:1.0.0.201903161436/maven-metadata.xml in local 
(C:\Users\ntle\.m2\repository), Could not find metadata 
com.castortech.iris.emf.forms:1.0.0.201903161436/maven-metadata.xml in 
castor (file:/C:/Users/ntle/git/baMavenRepo/castortech/)" 

2.add the "plugins" folder of my p2 site to 
org.ops4j.pax.url.mvn.repositories in org.ops4j.pax.url.mvn.cfg. Then 
manually build a feature.xml file with all of our bundles using file 
protocol 
(ie.<bundle>file:///C:/Users/ntle/git/baFileRepo/castortech/com.castortech.iris.ba.cdo_1.0.0.201901252341.jar</bundle>). 
Then in karaf, add this feature.xml as a feature repo and install the 
feature. However, i got this error: 
"Unable to resolve root: missing requirement [root] osgi.identity; 
osgi.identity=IrisBA; type=karaf.feature; version="[1.0.0,1.0.0]"; 
filter:="(&(osgi.identity=IrisBA)(type=karaf.feature)(version>=1.0.0)(version<=1.0.0))" 
[caused by: Unable to resolve IrisBA/1.0.0: missing requirement 
[IrisBA/1.0.0] osgi.identity; osgi.identity=com.castortech.filters.core; 
type=osgi.bundle; version="[1.0.0.201903112222,1.0.0.201903112222]"; 
resolution:=mandatory [caused by: Unable to resolve 
com.castortech.filters.core/1.0.0.201903112222: missing requirement 
[com.castortech.filters.core/1.0.0.201903112222] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=com.castortech.iris.utils.eclipse)(version>=1.0.0))" 
[caused by: Unable to resolve 
com.castortech.util.eclipse/1.0.0.201903051428: missing requirement 
[com.castortech.util.eclipse/1.0.0.201903051428] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.apache.commons.collections.map)(version>=1.0.0))"]]]" 

Is there another approach that i should try? 

One thing i noticed is that if i use bundle:install file:///pathToMyLocalJar 
then the jar got installed but only itself, no dependent bundle was pulled 
in. Does it mean dependency resolution only happen when installing feature? 

Thai Le 




--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html