【发布时间】:2014-04-11 06:42:55
【问题描述】:
我们正在改造现有的 Web 应用程序以包含使用 JBoss 6 EAP 和 CXF 的 SOAP 服务。我的问题是,即使我明确声明我希望在我的 .war 文件中包含某些依赖项(使用“compile {dependency}”),但它们并未包含在内。它似乎与其他库有关。
为了成为一个好人,我将所有 cxf 依赖项都列为 'providedCompile',因为 JBoss EAP 已经将它们包含在模块目录中:
providedCompile "org.apache.cxf:cxf-rt-transports-http:2.6.8"
providedCompile "org.apache.cxf:cxf-api:2.6.8"
providedCompile "org.apache.cxf:cxf-rt-bindings-soap:2.6.8"
providedCompile "org.apache.cxf:cxf-rt-bindings-xml:2.6.8"
providedCompile "org.apache.cxf:cxf-rt-core:2.6.8"
providedCompile "org.apache.cxf:cxf-rt-databinding-jaxb:2.6.8"
providedCompile "org.apache.cxf:cxf-rt-frontend-jaxws:2.6.8"
providedCompile "org.apache.cxf:cxf-rt-frontend-simple:2.6.8"
providedCompile "org.apache.cxf:cxf-tools-common:2.6.8"
providedCompile "org.apache.cxf:cxf-tools-validator:2.6.8"
providedCompile "org.apache.cxf:cxf-tools-wsdlto-core:2.6.8"
providedCompile "org.apache.cxf:cxf-tools-wsdlto-databinding-jaxb:2.6.8"
例如,我需要 dom4j。我知道我需要它,因为我在启动时看到 ClassNotFoundExceptions。
所以我将它添加到我的依赖项中:
compile "dom4j:dom4j:1.6.1"
没有快乐。也就是说,直到我将上述所有 'providedCompile' 语句更改为 'compile'。
我仍在努力制作一个简化的示例以在此处发布,但有其他人看到这样的奇怪行为吗?为什么一个“providedCompile”依赖阻止另一个“编译”依赖被包含在 .war 文件中?为什么我必须在我的 .war 中复制容器已经提供的库?
【问题讨论】:
-
您是否检查过该库不在战争中,或者您是否因为 ClassNotFoundException 而认为它不存在?
-
我通过列出 .war 的内容验证了库不在战争中