Skip to content

Better Annotation Processing for QueryDSL #1870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
babltiga opened this issue Nov 19, 2023 · 1 comment · Fixed by #1871
Closed

Better Annotation Processing for QueryDSL #1870

babltiga opened this issue Nov 19, 2023 · 1 comment · Fixed by #1871
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@babltiga
Copy link
Contributor

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 19, 2023
babltiga added a commit to babltiga/spring-data-couchbase that referenced this issue Nov 19, 2023
babltiga added a commit to babltiga/spring-data-couchbase that referenced this issue Nov 19, 2023
@mikereiche
Copy link
Collaborator

I'm on vacation. I'll look at this next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants