0 Replies Latest reply on Aug 26, 2013 9:13 AM by patrick_roemer

    Referencing externally deployed jars from persistence.xml in EAR

    patrick_roemer

      Given the following deployment layout:

       

      deployments

      - app.ear

      - entities.jar

       

      The EAR contains a MANIFEST.MF declaring

       

      Dependencies: deployment.entities.jar

       

      and a persistence.xml with the entry

       

      <jar-file>../entities.jar</jar-file>

       

      Can I rely on the resolved jar-file URL provided by PersistenceUnitInfo#getJarFileUrls() to point to the externally deployed entities.jar (i.e. vfs:/content/entities.jar), thus "escaping" the EAR? I have tried it with EAP 6.1.0 and it works there - but can I rely on it?

       

      Of course one could argue that it's bad practice to have an EAR depend on anything other than modules and its own contents - but this has already gone down the drain with the class path dependency in the manifest, anyway. So to rephrase my question: Given that such a class path dependency already is in the mix, what's the proper way to reference it from the persistence.xml? Are there any other (better) approaches to achieve the same effect?

       

      If this is not the proper forum for this question, please point me to a more appropriate location.

       

      Thanks and best regards,

      Patrick