我在 Fuse 中有一个 CXF Web 服务应用程序,它在骆驼上下文 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>