我正在尝试在一个新的 Spring 项目中使用 QueryDsl。我是 QueryDsl 的新手,对 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>
我在那个项目中有两个@Entity。
mvn clean install 不会导致任何输出到 target/generated-sources/java/
我错过了什么?
我尝试了 mvn apt: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)
有什么建议么?
谢谢!