How to create QueryDsl Q-classes by specifying only the package name? Given that the source classes are in my target / generated-sources folder, as they are the product of other build plugins (WSDL, XSD, etc.).
I tried using the following plugins, but cannot find the correct configuration:
<groupId>com.mysema.querydsl</groupId> <artifactId>querydsl-maven-plugin</artifactId> <version>2.9.0</version> <executions> <phase>generate-sources</phase> <goals> <goal>process</goal> </goals> <configuration> <outputDirectory>target/generated-sources</outputDirectory> <processor>${com.mysema.query.apt.ProcessorClass}</processor> </configuration> </executions>
and
<groupId>com.mysema.maven</groupId> <artifactId>maven-apt-plugin</artifactId> <version>1.0.4</version>
What I would like to do is something like this:
<configuration> <packageName>com.my.package</packageName> <sourceFolder>target/generated-sources</sourceFolder> <targetFolder>target/generated-sources/querydsl</targetFolder> </configuration>
... which will generate classes:
- com.my.package.QFoo.java
- com.my.package.QBar.java
Since there is no general JPA or JDO annotation, and I do not have access to the source files, I could not use any of com.mysema.query.apt.*Processor for maven-apt-plugin <processor> .
EDIT 1: Added full maven-apt-plugin configuration.
EDIT 2: - I managed to get maven-apt-plugin to work sporadically through the maven command line, but not Eclipse / STS, extending AbstractQuerydslProcessor to look for @XmlType XmlType-annotated classes. Dual code generation is admittedly not an ideal solution.
source share