Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] persistence.xml and "external jars"

First of all, I am sorry for the cross post, but I really think members of both projects might be helpful.

My persistence.xml is like the following :

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
<persistence-unit name="test" transaction-type="JTA">

<provider>org.hibernate.ejb.HibernatePersistence</provider>

<jta-data-source>java:/testDS</jta-data-source>
<jar-file>../WEB-INF/lib/jar1-1.0.6-SNAPSHOT.jar</jar-file>
<jar-file>../WEB-INF/lib/jar2-1.0.6-SNAPSHOT.jar</jar-file>

....

Although these jar-file definitions are valid with regard to at least the JEE6 (JPA2) spec, eclipse can't find the projects (even if they are open in the workspace).
I can think of several ways it could be done.

First solution : I tried to use an ear. I placed the persistence.xml in a dedicated jar (containing solely the file, not the entities). In that setup, I had removed the "WEB-INF/lib/" part. Although it worked in JBoss, it does not in eclipse. In my opinion, since the ear knows its dependencies, wtp should be able to resolve all persistence jars

Second solution (that's why I am cross-posting in this ML), m2e-wtp might be used as an additional persistence jar resolver by looking for artifacts matching the finalName jar name.

Is this already possible another way ?
Would there be a way to do this in near future ?
Would there be a complex work-around ?

PS : I should add that any advice on puting the persistence.xml in the same jar as the entities would be irrelevant to us, both for pratical reasons and for external architectural reasons.

PS2 : I am sorry I am not first posting to the eclipse user forums since I seem to encounter some authentication issue I do not see any solution to and there seems to be no users mailing lists any more.

Thx in advance, even for simple pointers.
Jean Couillaud

Back to the top