querydsl / apt-maven-plugin

Maven APT plugin
Apache License 2.0
79 stars 41 forks source link

Plugin fails with QueryDSL 4 #53

Open jvence opened 7 years ago

jvence commented 7 years ago

Plugin was working perfectly until we upgraded QuertDsl to version 4 (which is now standard on Spring Boot) and everything breaks.

Shredder121 commented 7 years ago

everything breaks

Could you be a bit more specific? Or maybe add a reproduction project so we can see for ourselves what goes wrong?

jbrokamp commented 7 years ago

What @jvence is most likely referring to is, when upgrading your application from spring-boot 1.3 (or before) to 1.4 or higher. This breaks correct generation of the query classes, who still refer to an older version of querydsl (pre-4).

If will probably suffice to update the plugin configuration to the new path of the JPAAnnotationProcessor. Which is at com.querydsl.apt.jpa.JPAAnnotationProcessor since querydsl 4.

@Shredder121, you should update the processor configuration for querydsl 4 in the readme, or add a note of some sort:

<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>
Shredder121 commented 7 years ago

Ah, that's something we can work with! Thanks.

karibe commented 6 years ago

I had similar problem after adjusting my configuration with official recomendations It could't find javax.inject and small modification helped:

<plugin>
    <groupId>com.mysema.maven</groupId>
    <artifactId>apt-maven-plugin</artifactId>
    <version>${apt-maven-plugin.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>process</goal>
            </goals>
            <configuration>
                <outputDirectory>target/generated-sources/apt</outputDirectory>
                <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>
    </dependencies>
</plugin>