我有一个单独的jar包含persistence.xml。这个jar被添加为具有实体的jar的父pom中的依赖项。我想启用静态编织。 根据EclipseLink documentation,我可以指定persistenceXMLLocation作为配置。但是,如果此位置是我的persistence.xml或其存储库中的路径的绝对文件路径。另外我怎样才能建立我的实体jar启用编织?执行这个插件的maven命令是什么?如何使用Maven在远程persistence.xml中启用eclipseLink中的静态编织?
以下是执行插件时,我得到的错误:
Failed to execute goal de.empulse.eclipselink:staticweave-maven-plugin:1.0.0:weave (default-cli) on project BRBASE-techl-entities: Execution default-cli of goal de.empulse.eclipselink:staticweave-maven-plugin:1.0.0:weave failed:
[ERROR] Exception Description: An exception was thrown while trying to load persistence unit at url: file:/D:/BRIDGE/BRIDGE-PARTIAL/BRBASE_Branch_selective_fetch/src/core/techl/entities/target/classes/
[ERROR] Internal Exception: Exception [EclipseLink-30004] (Eclipse Persistence Services - 2.5.1.v20130824-981335c): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
[ERROR] Exception Description: An exception was thrown while processing persistence.xml from URL: file:/D:/BRIDGE/BRIDGE-PARTIAL/BRBASE_Branch_selective_fetch/src/core/techl/entities/target/classes/
[ERROR] Internal Exception: java.net.MalformedURLException: NullPointerException
在这里,它寻找的实体项目的类路径persistence.xml文件。
我使用mvn命令是:
de.empulse.eclipselink:staticweave-maven-plugin:weave
插件是:使用
<plugin>
<groupId>de.empulse.eclipselink</groupId>
<artifactId>staticweave-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>weave</goal>
</goals>
<configuration>
<logLevel>FINE</logLevel>
<persistenceXMLLocation>D:\BRIDGE\BRIDGE-PARTIAL\DB\persistence-config\src\main\resources\META-INF\persistence.xml</persistenceXMLLocation>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.5.1-RC1</version>
</dependency>
<dependency>
<groupId>com.mindtree.bridge.platform.db</groupId>
<artifactId>BRDB-persistence-config</artifactId>
<version>${db.version}</version>
</dependency>
</dependencies>
</plugin>
的EclipseLink版本:2.5.1-RC1
是有什么我失踪?
D:\ BRIDGE \ BRIDGE-PARTIAL \ DB \ persistence-config \ src \ main \ resources \ META-INF/persistence.xml中的最后一个URL分隔符 – Rima
@Rima:这是行不通的。无论如何,在错误中,它显示它试图从主项目的资源文件夹中获取persistence.xml – Amrita