직장에서 여러 클라이언트가 라이브러리 (여러 서블릿, 데스크탑 응용 프로그램 등)에 사용되는 엔티티 라이브러리가 있습니다. 엔티티 라이브러리는 JPA 주석 클래스와 가장 두드러지게 persistence.xml로 구성됩니다.어디에서 maven을 사용하여 라이브러리 jar에 persistence.xml을 넣을 수 있습니까?
모든 프로젝트는 maven을 사용하여 구성됩니다.
여기서 persistence.xml 파일을 넣어야합니까? 해당 엔티티 라이브러리의 jar 파일 안에 위치해야하며 maven을 사용하여 구성하는 방법을 모르겠습니다.
는'이것에 대해 명확하게하려면'업데이트는 '' '의 persistence.xml을하고 다른 하나를 포함하는 하나의 메이븐-을 투사가 ((우리는 여러 개의 작은 프로젝트로 프로젝트를 분할하는) B)는 그 프로젝트에 달려있다. 나는 persistent.xml 파일을 src/main/resources/META-INF/persistence.xml에 넣습니다. A에서 EntityManager를 사용할 때 아무런 문제가 없습니다. insidie B : 아무것도 작동하지 않습니다.
는 EclipseLink는 다음과 같은 경고 제공 :
[EL Warning]: The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element
나는 persistence.xml을 찾을 수없는 의심을하지만, 대상 항아리에 존재한다.
은 완벽하게 나를 위해 일했다. META-INF 폴더를 만들고 persistence.xml 파일을이 파일에 넣어야했습니다. – Sorter