JBoss收缩膜。正在从其他模块添加文件。

JBoss收缩膜。正在从其他模块添加文件。,jboss,dependencies,shrinkwrap,Jboss,Dependencies,Shrinkwrap,多模块项目 在我的ejb模块中,我有突出显示的文件。我想在web模块中使用运行arquillian测试的相同文件 <dependency> <groupId>com.comp</groupId> <artifactId>g4tc-ejb</artifactId> <type>ejb</type> <!-- Use scope provided

多模块项目

在我的ejb模块中,我有突出显示的文件。我想在web模块中使用运行arquillian测试的相同文件

<dependency>
        <groupId>com.comp</groupId>
        <artifactId>g4tc-ejb</artifactId>
        <type>ejb</type>
        <!-- Use scope provided as we are creating an ear file, and we do not want the packaged jar file in test, as we want the test-persistence.xml -->
        <scope>provided</scope>
    </dependency>
在web模块中的pom.xml文件中,我依赖于ejb模块,但提供了作用域,因为我不希望从ejb模块获取“真正的”persistence.xml

<dependency>
        <groupId>com.comp</groupId>
        <artifactId>g4tc-ejb</artifactId>
        <type>ejb</type>
        <!-- Use scope provided as we are creating an ear file, and we do not want the packaged jar file in test, as we want the test-persistence.xml -->
        <scope>provided</scope>
    </dependency>

最好的方法是什么??谢谢

通过检查ejb/target/classes,一种快速而肮脏的方法是检查是否可以在类路径上找到这些文件。如果是这种情况,只需添加:

.addAsResource(g4TravelCenterTest-ds.xml)
.addAsResource(import.sql)
.addAsResource(META-INF/test-persistence.xml)