没有使用QueryDsl版本更新生成QClasses

问题描述 投票:0回答:1

我使用JPAQueryDsl 3.4.1这个配置,一切都很好,我生成了我的QClasses。

    <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-apt</artifactId>
        <version>3.4.1</version>
    </dependency>
    <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-jpa</artifactId>
        <version>3.4.1</version>
    </dependency>

    ....

    <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> 

但当我试图更新到版本4.1.3同时也改变了JPAAnnotationProcessorcom.mysema.query.apt.jpa.JPAAnnotationProcessor 和官方apt-maven-plugin中的1.1.3版本到doc,目录target/generated-sources/java是空的,没有生成QClasses

<dependency>
  <groupId>com.querydsl</groupId>
  <artifactId>querydsl-apt</artifactId>
  <version>4.1.3</version>
</dependency>

<dependency>
  <groupId>com.querydsl</groupId>
  <artifactId>querydsl-jpa</artifactId>
  <version>4.1.3</version>
</dependency>

...

<plugin>
  <groupId>com.mysema.maven</groupId>
  <artifactId>apt-maven-plugin</artifactId>
  <version>1.1.3</version>
  <executions>
    <execution>
      <goals>
        <goal>process</goal>
      </goals>
      <configuration>
        <outputDirectory>target/generated-sources/java</outputDirectory>
        <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
      </configuration>
    </execution>
  </executions>
</plugin>
maven jpa querydsl
1个回答
0
投票

使用这个插件:

<plugin>
    <groupId>org.bsc.maven</groupId>
    <artifactId>maven-processor-plugin</artifactId>
    <configuration>
        <defaultOutputDirectory>target/generated-sources/java</defaultOutputDirectory>
        <processors>
            <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
        </processors>
    </configuration>
    <executions>
        <execution>
            <id>process</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>process</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
            <version>4.1.4</version>
        </dependency>
    </dependencies>
</plugin>
© www.soinside.com 2019 - 2024. All rights reserved.