我在Fuse中有一个CXF web服务应用程序,它在camel上下文xml文件中引用了包含我从WSDL生成的文件的jar。
<cxf:cxfEndpoint id="LookupEndpoint"
address="${my.LookupUri}"
serviceClass="com.whatever.IWebService"
wsdlURL="wsdl/MyWsdl.wsdl"/> com.whatever.*在我的<Import-Package>列表中。jar在我的maven依赖项中。我可以说是import com.whatever.IWebService;,它没有抱怨。
但是maven-bundle-plugin在MANIFEST.MF中不包括这个包。
它包括了我所要求的所有其他包裹。但这次不行。所以在Fuse中,当我部署它时,我得到了ClassNotFoundException,它引用了context.xml类的加载。
这很令人沮丧。有没有办法强迫插件导入某个包?因为他们的自动魔法依赖解决程序忽略了我的<Import-Package>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${version.maven-bundle-plugin}</version>
<extensions>true</extensions>
<configuration>
<manifestLocation>src/main/resources/META-INF</manifestLocation>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>
*,
com.imports.this.one.fine*,
com.imports.this.one.just.fine*,
com.imports.does.not.import.this.one.*,
</Import-Package>
<Export-Package>
com.something.export.*
</Export-Package>
</instructions>
</configuration>
</plugin>发布于 2016-08-25 14:28:48
当您在通配符中使用<Import-Package>时,将为包中代码依赖于OSGi的通配符的所有包生成一个导入包头。
如果maven- bundle插件没有为您期望的包生成导入,这意味着包中的代码实际上并不引用该包。
与其导入此包,不如将其包含在包中吗??你为什么要进口它?
https://stackoverflow.com/questions/39147634
复制相似问题