Skip to content

Better Annotation Processing for QueryDSL #1870

Closed
@babltiga

Description

@babltiga

Currently, the annotation processing for QueryDSL is done via CouchbaseAnnotationProcessor which is not "auto-discovery" enabled, which makes it hard to use in gradle and maven projects, as it requires some advanced configuration. I propose we add the CouchbaseAnnotationProcessor to the META-INF/services/javax.annotation.processing.Processor file so it can be auto-discovered if the jar is added as an annotation processor on the project.

So project configuration can be as simple as

For Maven projects

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>[compiler-plugin-version]</version>
            <configuration>
                <annotationProcessorPaths>
                    <!-- path to the annotation processor -->
                    <path>
                        <groupId>com.querydsl</groupId>
                        <artifactId>querydsl-apt</artifactId>
                        <version>[version]</version>
                    </path>
                    <path>
                        <groupId>org.springframework.data</groupId>
                        <artifactId>spring-data-couchbase</artifactId>
                        <version>[version]</version>
                    </path>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</build>

Gradle projects

annotationProcessor 'com.querydsl:querydsl-apt:${querydslVersion}'
annotationProcessor 'org.springframework.data:spring-data-couchbase:${springDataCouchbaseVersion}'

Will push a PR with a proposal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions