A project with several modules.

In my ejb module I have dedicated files. I would like to use the same files that run the arquillian test in the web module.
In the pom.xml file in the web module, I have a dependency on the ejb module, but with scope, since I don't want to get the "real" persistence.xml from the ejb module.
<dependency> <groupId>com.comp</groupId> <artifactId>g4tc-ejb</artifactId> <type>ejb</type> <scope>provided</scope> </dependency>
So, in the RestTest class, I want to include files from the ejb module.
@Deployment public static WebArchive getDeployment() { File[] files = Maven.resolver().loadPomFromFile("pom.xml") .importRuntimeAndTestDependencies().resolve().withTransitivity().asFile(); WebArchive war = ShrinkWrap.create(WebArchive.class, "g4tcRestWebservice.war") .addAsLibraries(files) .addPackages(true, "com.comp.g4tc.web") .addPackages(true, "com.comp.g4tc.ejb") .addAsResource( "HERE AT THE test-persistence.xml FROM THE EJB MODULE", "META-INF/persistence.xml"); System.out.println(war.toString(true)); return war; }
What is the best approach for this. ?? Thanks
klind source share