Java 在JBoss Fuse中处理非OSGI依赖的可传递依赖
我正在使用JBoss Fuse 6.2和Fabric。我有一个编译成OSGI包的应用程序。应用程序依赖于一个非OSGI jar文件(multiplier.jar),而这个依赖于另一个非OSGI jar文件(adder.jar) 应用程序包和两个依赖项都位于本地Maven存储库中 我定义的features.xml文件如下所示:Java 在JBoss Fuse中处理非OSGI依赖的可传递依赖,java,fuseesb,jbossfuse,fabric8,Java,Fuseesb,Jbossfuse,Fabric8,我正在使用JBoss Fuse 6.2和Fabric。我有一个编译成OSGI包的应用程序。应用程序依赖于一个非OSGI jar文件(multiplier.jar),而这个依赖于另一个非OSGI jar文件(adder.jar) 应用程序包和两个依赖项都位于本地Maven存储库中 我定义的features.xml文件如下所示: <?xml version="1.0" encoding="UTF-8"?> <features name="CamelLogRepo" xmlns="h
<?xml version="1.0" encoding="UTF-8"?>
<features name="CamelLogRepo" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
<feature name="multiplier-logger">
<bundle>mvn:org.jboss.quickstarts.fuse/beginner-camel-log/6.2.0.redhat-133</bundle>
<bundle>wrap:mvn:com.acme.math.multiply/multiplier/1.0</bundle>
<bundle>wrap:mvn:com.acme.math.add/adder/1.0</bundle>
</feature>
</features>
这很有效
但是,我必须在features.xml文件中列出所有可传递的依赖项。有没有办法避免这种情况
我的印象是Fuse可以执行Maven依赖项查找,因此,如果一个依赖项在存储库中有一个pom.xml,其中列出了另一个依赖项,Fuse将自动加载该依赖项。是否有任何方法可以实现这一点,并使Fuse自动为非OSGI依赖项使用wrap:
协议
具有两个依赖项的完整测试应用程序可以在此处找到:不,您必须列出所有依赖项,欢迎使用OSGi land 我们试图通过称为FAB[1]-Fuse应用程序包的东西将Maven的易用性添加到OSGi中。但这两个世界太不一样了。因此,不幸的是,在osgiland中,您最好列出特性文件中的所有依赖项
- [1]
希望这对某些人有所帮助,并且按照Fuse版本6.2,不推荐使用晶圆厂包装,对吗?基于JBoss EAP的6.2.1版对此是否有更好的支持?
fabric:profile-create --parent feature-camel logger-profile
fabric:profile-edit --repository file:C:/Tools/jboss-fuse-6.2.0.redhat-133/quickstarts/beginner/camel-log/features.xml logger-profile
fabric:profile-edit --feature multiplier-logger logger-profile
fabric:container-create-child --profile logger-profile root logger