-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e4e3a2
commit 1ebb1b4
Showing
1 changed file
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
querydsl-groovy-maven | ||
===================== | ||
|
||
Sample using Querydsl APT Groovy and Maven | ||
Sample using QueryDSL APT processing in a Groovy and Maven project. | ||
|
||
Instructions: | ||
`Foo` is an `@Entity`. `QFoo` is a QueryDSL query object for `Foo` generated with APT (JSR-269). | ||
The annotation processor used is declared in `com.querydsl:querydsl-apt` in `META-INF/services/javax.annotation.processing.Processor`. | ||
`QFoo` is also referenced by `FooRepository` to prove that it's generated and compiled on the fly | ||
and can be safely used in other classes, even within the same project and source directory. | ||
Also as an example `generatedSourcesDirectory` is changed in `groovy-eclipse-compiler` configuration | ||
to prove that plugin configuration is applied to the annotation processor as well. | ||
|
||
In order for this to work you'll need to patch the querydsl-apt-2.6.0.jar file and include [this](https://github.com/downloads/renataogarcia/querydsl-groovy-maven/javax.annotation.processing.Processor) to the META-INF/services directory. | ||
Tested with: | ||
|
||
``` | ||
$ mvn -version | ||
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00) | ||
Java version: 1.8.0_60, vendor: Oracle Corporation | ||
``` |