Skip to content

Commit 8deccf5

Browse files
babltigamicopiira
authored andcommitted
Mark CouchbaseAnnotationProcessor for auto-discovery. (spring-projects#1871)
Closes spring-projects#1870
1 parent 179c48c commit 8deccf5

File tree

3 files changed

+78
-27
lines changed

3 files changed

+78
-27
lines changed

pom.xml

+31-26
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,37 @@
247247

248248
<build>
249249
<plugins>
250+
<plugin>
251+
<groupId>org.apache.maven.plugins</groupId>
252+
<artifactId>maven-compiler-plugin</artifactId>
253+
<dependencies>
254+
<dependency>
255+
<groupId>com.querydsl</groupId>
256+
<artifactId>querydsl-apt</artifactId>
257+
<version>${querydsl}</version>
258+
</dependency>
259+
</dependencies>
260+
<configuration>
261+
<proc>none</proc>
262+
</configuration>
263+
<executions>
264+
<execution>
265+
<id>test-annotation-processing</id>
266+
<phase>generate-test-sources</phase>
267+
<goals>
268+
<goal>testCompile</goal>
269+
</goals>
270+
<configuration>
271+
<proc>only</proc>
272+
<annotationProcessors>
273+
<annotationProcessor>org.springframework.data.couchbase.repository.support.CouchbaseAnnotationProcessor</annotationProcessor>
274+
</annotationProcessors>
275+
<generatedTestSourcesDirectory>target/generated-test-sources</generatedTestSourcesDirectory>
276+
</configuration>
277+
</execution>
278+
</executions>
279+
</plugin>
280+
250281
<plugin>
251282
<groupId>org.apache.maven.plugins</groupId>
252283
<artifactId>maven-surefire-plugin</artifactId>
@@ -290,32 +321,6 @@
290321
<groupId>org.asciidoctor</groupId>
291322
<artifactId>asciidoctor-maven-plugin</artifactId>
292323
</plugin>
293-
<plugin>
294-
<groupId>com.mysema.maven</groupId>
295-
<artifactId>apt-maven-plugin</artifactId>
296-
<version>${apt}</version>
297-
<dependencies>
298-
<dependency>
299-
<groupId>com.querydsl</groupId>
300-
<artifactId>querydsl-apt</artifactId>
301-
<version>${querydsl}</version>
302-
</dependency>
303-
</dependencies>
304-
<executions>
305-
<execution>
306-
<phase>generate-test-sources</phase>
307-
<goals>
308-
<goal>test-process</goal>
309-
</goals>
310-
<configuration>
311-
<outputDirectory>target/generated-test-sources</outputDirectory>
312-
<processor>
313-
org.springframework.data.couchbase.repository.support.CouchbaseAnnotationProcessor
314-
</processor>
315-
</configuration>
316-
</execution>
317-
</executions>
318-
</plugin>
319324
</plugins>
320325
</build>
321326

src/main/antora/modules/ROOT/pages/couchbase/repository.adoc

+46-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,51 @@ public class Config extends AbstractCouchbaseConfiguration {
3131

3232
An advanced usage is described in <<couchbase.repository.multibucket>>.
3333

34+
[[couchbase.repository.configuration.dsl]]
35+
=== QueryDSL Configuration
36+
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.
37+
38+
.Maven Configuration Example
39+
====
40+
[source,xml]
41+
----
42+
<build>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-compiler-plugin</artifactId>
47+
<version>[compiler-plugin-version]</version>
48+
<configuration>
49+
<annotationProcessorPaths>
50+
<!-- path to the annotation processor -->
51+
<path>
52+
<groupId>com.querydsl</groupId>
53+
<artifactId>querydsl-apt</artifactId>
54+
<version>[version]</version>
55+
</path>
56+
<path>
57+
<groupId>org.springframework.data</groupId>
58+
<artifactId>spring-data-couchbase</artifactId>
59+
<version>[version]</version>
60+
</path>
61+
</annotationProcessorPaths>
62+
</configuration>
63+
</plugin>
64+
</plugins>
65+
</build>
66+
67+
----
68+
====
69+
70+
.Gradle Configuration Example
71+
====
72+
[source,groovy]
73+
----
74+
annotationProcessor 'com.querydsl:querydsl-apt:${querydslVersion}'
75+
annotationProcessor 'org.springframework.data:spring-data-couchbase:${springDataCouchbaseVersion}'
76+
----
77+
====
78+
3479
[[couchbase.repository.usage]]
3580
== Usage
3681

@@ -361,7 +406,7 @@ public interface AirportRepository extends PagingAndSortingRepository<Airport, S
361406
----
362407
====
363408

364-
[[dto-projections]]
409+
[[couchbase.repository.dto-projections]]
365410
=== DTO Projections
366411

367412
Spring Data Repositories usually return the domain model when using query methods.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.data.couchbase.repository.support.CouchbaseAnnotationProcessor

0 commit comments

Comments
 (0)