将/ src / main / java文件夹添加到Arquillian进行部署

时间:2017-09-25 13:10:57

标签: jboss-arquillian

我想将src / main / java文件夹中的所有java包(和类)添加到Arquillian部署中,如下所示:

@RunWith(Arquillian.class)
public class ArquillianDeployment {

@Deployment
public static Archive<?> deploy() {
    return ShrinkWrap.create(WebArchive.class, "test.war")
            .// add here all java packages from src/main/java folder
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}

1 个答案:

答案 0 :(得分:0)

您可以改为使用addPackages

ShrinkWrap.create(WebArchive.class, "test.war")
    .addPackages(true, "my.rootPackage");