You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by eltonk <ku...@gmail.com> on 2012/08/23 14:22:24 UTC

include/exclude classpath

Hello there!

I was taking a look about the include/exclude classpath with the properties
"openejb.deployments.classpath.exclude" and
"openejb.deployments.classpath.include", but I'm not  able to solve the
problem by myself. :(

I have 2 properties files, called "hibernate.properties". One of them in
main/resource (used by real application) and the other one in test/resource
(to test purposes).

In my test environment, I need exclude the first one (main/resource) because
the second one (test/resource) should be used.

I'm trying do it as follow:

properties.setProperty("openejb.deployments.classpath.filter.descriptors",
"true");
properties.setProperty("openejb.deployments.classpath.include",
".*(target/classes|target/test-classes).*");
properties.setProperty("openejb.deployments.classpath.exclude",
".*target/classes/hibernate.properties");

The problem is that it isn't working. I'm not able to exclue the
"target/classes/hibernate.properties" from test's classpath.

My doubt is if the "exclude" path has priority over "include" path. As I'm
seeing it's not true. Am I right?

If I'm right, how can I do something such that?

I'm using ebedded OpenEJB to my tests.

Thanks a lot!



--
View this message in context: http://openejb.979440.n4.nabble.com/include-exclude-classpath-tp4657023.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: include/exclude classpath

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Or to use Maven filtering if applicable.

JLouis

2012/8/24 eltonk <ku...@gmail.com>

> Thank you for the tip! :)
>
> I'll try it.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/include-exclude-classpath-tp4657023p4657079.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: include/exclude classpath

Posted by eltonk <ku...@gmail.com>.
Thank you for the tip! :)

I'll try it.



--
View this message in context: http://openejb.979440.n4.nabble.com/include-exclude-classpath-tp4657023p4657079.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: include/exclude classpath

Posted by David Blevins <da...@gmail.com>.
On Aug 23, 2012, at 5:22 AM, eltonk wrote:

> Hello there!
> 
> I was taking a look about the include/exclude classpath with the properties
> "openejb.deployments.classpath.exclude" and
> "openejb.deployments.classpath.include", but I'm not  able to solve the
> problem by myself. :(
> 
> I have 2 properties files, called "hibernate.properties". One of them in
> main/resource (used by real application) and the other one in test/resource
> (to test purposes).

The trick here is that the include/exclude logic only affects the standard descriptors like ejb-jar.xml, persistence.xml, application-client.xml, application.xml plus the TomEE/OpenEJB created ones such as openejb-jar.xml or resources.xml.

Hibernate is the one who reads its own hibernate.properties and there's nothing we can do to prevent it from finding it if it's in the classpath.

The only thing I might suggest is to try to put 100% of your properties in the persistence.xml.  Then you can use the altDD support:

 - http://openejb.apache.org/examples-trunk/alternate-descriptors/


-David