我正在使用 Arquillian 将战争部署到 JBoss 7.x 中进行测试,它依赖于 Apache Commons Collections。但是,它似乎并没有拾取模块依赖性。
清单文件
Dependencies: org.apache.commons.collectionss export
Arquillian 部署
@Deployment
public static Archive<?> createDeployment() {
WebArchive archive = ShrinkWrap.create(WebArchive.class);
archive
.addPackages(true, "com.example.package")
.addAsResource("META-INF/MANIFEST.MF", "META-INF/MANIFEST.MF")
// * Tried the following two options with no luck
//.AddAsManifestResource("META-INF/MANIFEST.MF", "MANIFEST.MF")
//.AddAsWebInfResource("META-INF/MANIFEST.MF", "META-INF/MANIFEST.MF")
// * If I enable the following, it works fine. getLibrary just picks
// * up the lib through maven.
//.addAsLibraries(
// getLibrary("commons-collections:commons-collections:3.2.1"))
;
return archive;
}
我不想用,jboss-deployment-structure.xml
因为感觉就像用大锤敲碎坚果。
有任何想法吗?