在apache-karaf-2.3.10中安装依赖项jar文件 [英] Install dependency jar file in apache-karaf-2.3.10
问题描述
我正在尝试在Apache karaf-2.3.10容器中部署一个捆绑包,而该捆绑包又具有jar文件依赖性.复制依赖项jar文件以部署Apache-Karaf依赖目录后,问题得到解决.如何通过命令行安装普通jar.我尝试了以下命令
I am trying to deploy an bundle in Apache karaf-2.3.10 container which inturn has jar file dependencies. After copying the dependency jar file to deploy dirctory of Apache-Karaf dependency issue got resolved. How to install the normal jar through command line. I tried the below command
osgi:install -s 'wrap:mvn:<path to the jar file/test.jar>'
显示
执行命令时出错:安装软件包时出错:
Error executing command: Error installing bundles:
我的捆绑软件有很多依赖项jar文件.我是否需要复制所有jar文件才能部署目录?如果这样,它将变得凌乱. 还有其他方法可以指向该位置或创建配置文件,以便在激活捆绑包中解决依赖性.
My bundle has lot of dependency jar files. Do i need to copy all the jar files to deploy directory? If, it will become messy. Is there any other way to point the location or creation a config file so that in activation bundles dependencies will be resolved.
推荐答案
是的,这对于OSGi应用程序是正常的. 为此,您可以将功能与Apache Karaf一起使用. 因此,请查看相应的文档:
Yes, and this is normal for OSGi applications. For this you can use features with Apache Karaf. So please take a look at the corresponding documentation:
要素中的包装束可能具有以下包装"的Maven坐标:
a wrapped bundle in a feature might have the following "wrapped" maven coordinate:
<bundle>wrap:mvn:my.group.id/my.artifact/version</bundle>
关于功能存储库,只要可以导航到存储库(功能文件)的链接,则它们可以是任何种类.例如,以下是有效的坐标":
Regarding Features Repositories, those can be of any kind, as long as the link to the repository (Feature file) can be navigated to. For Example the following are valid "coordinates":
file:/filesystem/to/my/so/awesome/features.xml
https://remote.Link.to/my/so/awesome/features.xml
mvn:my.group.id/my.artifact/version/xml/features
如果您的本地Maven存储库中确实包含一个功能Maven工件,它将被视为要查找的工件.
If your local maven repository does contain a features maven artifact it will be treated as the one to look for.
功能存储库的添加者:
feature:repo-add mvn:my.group.id/my.artifact/version/xml/features
通过卡夫贝壳.或在构建自定义Karaf时添加为"bootfeature". 同样,可以在文档中找到更多详细信息.
via karaf shell. Or added as "bootfeature" while building custom Karaf. Again, more details can be found in the documentation.
这篇关于在apache-karaf-2.3.10中安装依赖项jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!