Spring Data Jpa Query DSL Q Entityclasses not generating

余生颓废 提交于 2019-12-03 22:22:55

There are conflicts between your mvn apt plugins. You have two of them, You only need one. just change them accordingly. Here's an example.

    <plugin>
        <groupId>org.bsc.maven</groupId>
        <artifactId>maven-processor-plugin</artifactId>
        <version>2.2.4</version>
        <configuration>
            <defaultOutputDirectory>
                ${project.build.directory}/generated-sources
            </defaultOutputDirectory>
            <processors>
                <processor>org.mapstruct.ap.MappingProcessor</processor>
                <processor>com.mysema.query.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>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
            </dependency>
        </dependencies>
    </plugin>

It's also possible to do the reverse and use the apt-maven-plugin should you wish to do so, the configuration is very similar:

<plugin>
    <groupId>com.mysema.maven</groupId>
    <artifactId>apt-maven-plugin</artifactId>
    <version>1.1.3</version>
    <dependencies>
        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
            <version>${querydsl.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>process</goal>
            </goals>
            <configuration>
                <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
                <processors>
                    <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
                    <processor>org.mapstruct.ap.MappingProcessor</processor>
                </processors>
            </configuration>
        </execution>
    </executions>
</plugin>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!