I have a project that uses the com.mysema.maven:apt-maven-plugin:1.0.4
to automatically generate classes used for query-DSL.
The project builds fine with maven executed on the command-line.
However, when I build the same project within Eclipse the "Q-classes" (so-called because they all have a name prefixed with 'Q') are generated except one of them:
Class QZHStRegisterJPBaseOptimisticLockingEntity
is generated as "empty" file.
Oddly, that generated source file is not completely empty but it contains a package name and two imports but nothing more, i.e. it contains no class declaration and thus that class (which is referred to by many other classes) does not exists leading to tons of compile errors.
This is how the generated source file looks like:
package ch.zh.ksta.zhstregisterjp.dom.base;
import static com.mysema.query.types.PathMetadataFactory.*;
import com.mysema.query.types.path.*;
Does anyone have any idea why this is not working and what could cause the apt-maven-plugin to emit such a "half-baken" incomplete file???
Just in case: the plugin does get executed. I have defined a Maven lifecycle-mapping in eclipse like so:
...
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId> <!-- the new artifactId -->
<versionRange>[1.0.4,)</versionRange>
<goals>
<goal>generate-sources</goal>
<goal>process</goal>
<goal>test-process</goal>
</goals>
</pluginExecutionFilter>
<action>
<!-- ->
<ignore/>
<!- -->
<execute>
<runOnConfiguration>true</runOnConfiguration>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
...
Also, the Q-classes are generated fine during the build, except for that single "empty" one mentioned.