使用 ANT 生成元模型时出错
Errors While Generating Metamodel Using ANT
我正在尝试使用 ANT 生成 EclipseLink JPA 元模型
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="antan" name="Annotation">
<property name="target" value="1.6" />
<property name="source" value="1.6" />
<property name="src.dir" value="D:/project/test/entity/" />
<property name="target.dir" value="D:/project/test/target/" />
<property name="src.lib" location="public_html/WEB-INF/lib" />
<path id="classpath">
<fileset dir="${src.lib}">
<include name="*.jar" />
</fileset>
</path>
<target name="antan">
<javac srcdir="${src.dir}"
destdir="${target.dir}"
failonerror="false"
fork="true">
<compilerarg value="-proc:only"/>
<classpath refid="classpath" />
</javac>
</target>
</project>
但是我收到以下错误,这可能是什么原因?
Bad service configuration file, or exception thrown while constructing
Processor object: javax.annotation.processing.Processor: Provider
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor not found
缺少元模型生成器依赖项。在pom.xml
文件中添加Maven依赖如下:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.5.2</version>
</dependency>
或者,在 Maven Central 上查找最近的 JAR 文件。
我正在尝试使用 ANT 生成 EclipseLink JPA 元模型
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="antan" name="Annotation">
<property name="target" value="1.6" />
<property name="source" value="1.6" />
<property name="src.dir" value="D:/project/test/entity/" />
<property name="target.dir" value="D:/project/test/target/" />
<property name="src.lib" location="public_html/WEB-INF/lib" />
<path id="classpath">
<fileset dir="${src.lib}">
<include name="*.jar" />
</fileset>
</path>
<target name="antan">
<javac srcdir="${src.dir}"
destdir="${target.dir}"
failonerror="false"
fork="true">
<compilerarg value="-proc:only"/>
<classpath refid="classpath" />
</javac>
</target>
</project>
但是我收到以下错误,这可能是什么原因?
Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor not found
缺少元模型生成器依赖项。在pom.xml
文件中添加Maven依赖如下:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
<version>2.5.2</version>
</dependency>
或者,在 Maven Central 上查找最近的 JAR 文件。