在apache-karaf-2.3.10安装依赖jar文件 [英] Install dependency jar file in apache-karaf-2.3.10

查看:33
本文介绍了在apache-karaf-2.3.10安装依赖jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 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:

Apache Karaf 配置和功能

功能中的包装包可能具有以下包装"的 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 shell.或者在构建自定义 Karaf 时添加为引导功能".同样,可以在文档中找到更多详细信息.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆