From 2ea03725a37c740a39801c1350167c175e54df8b Mon Sep 17 00:00:00 2001 From: Tigran Babloyan Date: Sun, 19 Nov 2023 23:49:06 +0400 Subject: [PATCH] Mark CouchbaseAnnotationProcessor for auto-discovery. Closes #1870 --- pom.xml | 57 ++++++++++--------- .../ROOT/pages/couchbase/repository.adoc | 47 ++++++++++++++- .../javax.annotation.processing.Processor | 1 + 3 files changed, 78 insertions(+), 27 deletions(-) create mode 100644 src/main/resources/META-INF/services/javax.annotation.processing.Processor diff --git a/pom.xml b/pom.xml index 8dc5e5423..a172d5c0e 100644 --- a/pom.xml +++ b/pom.xml @@ -247,6 +247,37 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + com.querydsl + querydsl-apt + ${querydsl} + + + + none + + + + test-annotation-processing + generate-test-sources + + testCompile + + + only + + org.springframework.data.couchbase.repository.support.CouchbaseAnnotationProcessor + + target/generated-test-sources + + + + + org.apache.maven.plugins maven-surefire-plugin @@ -290,32 +321,6 @@ org.asciidoctor asciidoctor-maven-plugin - - com.mysema.maven - apt-maven-plugin - ${apt} - - - com.querydsl - querydsl-apt - ${querydsl} - - - - - generate-test-sources - - test-process - - - target/generated-test-sources - - org.springframework.data.couchbase.repository.support.CouchbaseAnnotationProcessor - - - - - diff --git a/src/main/antora/modules/ROOT/pages/couchbase/repository.adoc b/src/main/antora/modules/ROOT/pages/couchbase/repository.adoc index 2efe9dc50..ede1221ba 100644 --- a/src/main/antora/modules/ROOT/pages/couchbase/repository.adoc +++ b/src/main/antora/modules/ROOT/pages/couchbase/repository.adoc @@ -31,6 +31,51 @@ public class Config extends AbstractCouchbaseConfiguration { An advanced usage is described in <>. +[[couchbase.repository.configuration.dsl]] +=== QueryDSL Configuration +Spring Data Couchbase supports QueryDSL for building type-safe queries. To enable code generation you need to set `spring-data-couchbase` as annotation processor on your project. + +.Maven Configuration Example +==== +[source,xml] +---- + + + + org.apache.maven.plugins + maven-compiler-plugin + [compiler-plugin-version] + + + + + com.querydsl + querydsl-apt + [version] + + + org.springframework.data + spring-data-couchbase + [version] + + + + + + + +---- +==== + +.Gradle Configuration Example +==== +[source,groovy] +---- +annotationProcessor 'com.querydsl:querydsl-apt:${querydslVersion}' +annotationProcessor 'org.springframework.data:spring-data-couchbase:${springDataCouchbaseVersion}' +---- +==== + [[couchbase.repository.usage]] == Usage @@ -361,7 +406,7 @@ public interface AirportRepository extends PagingAndSortingRepository