i have multi module maven project, that have a module for spring jpa repositories, and a module of domain entities. domain module is dependency of repositories module. the apt-maven-plugin is on the repositories module. i want to JPAAnnotationProcessor scan entities in domain module and generate Q classes in repositories module.
how can i configure this?
Best How To :
This is not possible.
The JPAAnnotationProcessor is an APT plugin for Maven. APT stands for Annotation Processing Tool, which is executed at compile-time. More precisely it wraps the compiler in order to generate more sources that will also be compile afterwards. See also http://www.javalobby.org/java/forums/t17876.html
This means that the Querydsl APT Maven plugin must be configured in the modules where the sources reside that have to be processed.
But this is typically what you want. The Q-classes are meta-models, i.e. they describe your domain models and therefore belong to them. Your repositories operate on them as well as the do with the entities (meta-models to describe the query, entities are returned by repositories).