Hi guys,

 

I'm trying to solve this issue for a few days and haven't been able to
crack it so far. The scenario is following:

 

I have a parent project that includes sub-modules, each having their own
pom.xml. Each of these modules produces an ejb3 package. I want to be
able to run unit/integration tests using the JBoss embedded container on
those modules from the parent project (so that it builds all modules).
The resources are different for the test phase from the ones to be
deployed (obviously). Normally it could all be achieved using
src/main/resources and src/test/tesources but in this case SureFire can
see all the resource files on its classpath and tries to use them (eg
persistence.xml -> tries to deploy test AND live persistence units which
fails the tests).

 

I kind of hacked it so that I'm able to run tests in one module and
package it. I end up with the following structure:

 

A

--target

----classes

------META-INF (incl resources for tests, dependent modules can use
these, when deploying this module's EJBs in the embedded JBoss for
example)

----test-classes

--A.jar (includes META-INF with resources for deployment)

 

When I run the build from the parent project though, it builds the first
one properly (eg A.jar) and when testing project B (which depends on A)
it can see on its classpath A/target/classes + A/target/test-classes
(this includes the proper resources for passing the tests) AND the built
A.jar (deployment - ready, including resources that fail the tests).

 

Dependency in B pom.xml is:

 

<dependency>

<groupId>foo</groupId>

<artifactId>A</artifactId>

<type>ejb</type>

<scope>provided</scope>

</dependency>

 

Is there a way how to exclude built A.jar from classpath when two
modules are dependent?

 

Hope this makes sense,

 

Petr 



The information contained in this email and its attachments is confidential and 
may be the subject of legal, professional or other privileged information. It 
is intended only for the named addressees and may not be disclosed to anyone 
else without consent from On Demand. If you are not the named addressee you 
must not use, disclose, distribute, copy, print or rely on the contents of this 
email and should destroy it immediately. Whilst On Demand takes care to protect 
its systems from electronic virus attack or other harmful event, the firm gives 
no warranty that this email message (including any attachments to it) is free 
of any virus or other harmful matter and accepts no responsibility for any loss 
or damage resulting from the recipient receiving, opening or using it. If you 
need any further information, please contact the originator of this message on 
+44 (0)20 7131 6700. Website: www.ondemand.co.uk. Registered Office: 1 Stephen 
Street, London, W1T 1AL. Registered in the UK No.4094951.

This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com

Reply via email to