I\'m trying to set up a Gradle build script for a new project. That project will use JPA 2 along with Querydsl.
On the following page of Querydsl\'s reference docume
To use the JPA Metamodel Generator with Gradle I'm successfully using the following in my build.gradle and it works like a charm:
buildscript {
ext {}
repositories { // maven central & plugins.gradle.org/m2 }
dependencies {
// other dependencies, e.g. Spring
classpath('gradle.plugin.at.comm_unity.gradle.plugins:jpamodelgen-plugin:1.1.1')
}
apply plugin: 'at.comm_unity.gradle.plugins.jpamodelgen'
dependencies {
compile('org.hibernate:hibernate-jpamodelgen:5.1.0.Final')
}
jpaModelgen {
jpaModelgenSourcesDir = "src/main/java"
}
compileJava.options.compilerArgs += ["-proc:none"]
}
Within the build task, the static metamodel classes suffixed with '_' are generated. Afterwards they are located in the same directory as my @Entity models are.