Persistence.xml priority in hibernate project

I have an eclipse project with several banks for JPA / Hibernate. One of them contains META-INF/persistence.xml, and I want to override this by specifying my own persistence.xml. So I tried to use mine persistence.xmlin src/persistence.xmlas well src/META-INF/persistence.xml, but every time that it seems to jar/META-INF/persistence.xmlget. I also tried editing the eclipse project file and moved up higher than the included library, but still did not collect mine .classpath classpathentry path="bin"persistence.xml

<classpath>
    <classpathentry kind="src" path="src/main/java"/>
    <classpathentry kind="src" path="src/main/rules"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="output" path="bin"/>
    <classpathentry kind="con" path="DROOLS/Drools"/>
    <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/drools"/>
</classpath>

In the tutorial, I read:

You will need to override these defaults if you want to change them by adding your own persistence.xml to your class path, preceding the default one in drools-persistence-jpa.jar

+3
1

, persistence.xml src/persistence.xml src/META-INF/persistence.xml, , , jar/META-INF/persistence.xml .

persistence.xml META-INF/persistence.xml, . .classpath, src , .

src/main/java/META-INF/persistence.xml.

, Maven Maven, src/main/resources src/test/resources. , , , .

, .

+3

Source: https://habr.com/ru/post/1774485/


All Articles