我试图在一个新的 Spring 工程中使用 QueryDsl 。 我新到 QuryDsl, 并且非常新到 maven 和 Spring, 所以我可能错过了相当基本的东西, 但我无法获得 QueryDsl / Maven-apt-plugin 来生成我的 Q 类。 Querydsl 引用听起来很简单; 我认为我做了它所说的:
我配置了 pom. xml :
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0.3</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>
并且:
<repository>
<id>QUERYDSL</id>
<url>http://source.mysema.com/maven2/releases</url>
<layout>default</layout>
</repository>
并且:
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>2.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
我有两个@Enity在这个项目中。
mvn清洁装置不会导致目标/源/java/
我错过了什么?
我尝试了 mvn appt: process, 结果:
[ERROR] Failed to execute goal com.mysema.maven:maven-apt-plugin:1.0.3:process (default-cli) on project logging-implementation: Either processor or processors need to be given -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.mysema.maven:maven-apt-plugin:1.0.3:process (default-cli) on project logging-implementation: Either processor or processors need to be given
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
有什么建议吗?
谢谢!