【发布时间】:2014-08-20 08:38:49
【问题描述】:
当我在pom.xml 中添加以下代码以支持 Querydsl
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
我在使用 Eclipse 构建时遇到了这个错误。我认为它与类路径和 JDK jars 有关系
You need to run build with JDK or have tools.jar on the classpath.
If this occures during eclipse build make sure you run eclipse under JDK as well
(com.mysema.maven:apt-maven-plugin:1.0.6:process:default:generate-sources)
.classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
额外信息:
我的 maven 安装
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_45
PATH : %JAVA_HOME%\bin;
【问题讨论】:
-
你是如何运行这个项目的 Maven 构建的?在 Eclipse 中还是在命令行中?
-
我不运行 Maven 构建,我只使用 eclipse,当我将问题中的代码添加到 pom.xml 时出现错误。
-
如果你去
Windows > Preference > Maven > Installations,那里有什么条目?另外,您的.classpath是什么样的? -
当你在 Eclipse 之外运行它时这是否有效,或者这是一个 Eclipse 独有的问题?
-
我更新了我的问题@DonovanMuller
标签: java eclipse maven querydsl