-
Notifications
You must be signed in to change notification settings - Fork 40
Add support for staleness checking #24
Comments
The apt-amven-plugin does a staleness check https://github.com/mysema/apt-maven-plugin/blob/master/src/main/java/com/mysema/maven/apt/AbstractProcessorMojo.java#L236 Do you use the latest version? |
I am using the latest version as far as I can tell - 1.1.1 <!-- for querydsl-generated classes-->
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
<includes>
<include>mypackage.**.domain.**</include>
</includes>
</configuration>
</execution>
</executions>
</plugin> This is the output from
This is the output if I comment out the apt-maven-plugin:
|
I'm using apt-maven-plugin version 1.1.3 and the staleness checking doesn't work for me either. Every time the plugin is run the Q classes are regenerated. |
@martinkovacik Do you use the apt-maven-plugin with an IDE? The update via a temp folder is only used in incremental mode. |
@timowest No I don't use an IDE just command line maven 3.2.3 and apt-maven-plugin 1.1.3. The same happens using maven-compiler-plugin 3.0, 3.1 and 3.2. I tried several versions of maven-compiler-plugin because of the https://jira.codehaus.org/browse/MCOMPILER-209 bug. I don't know if this could be related. |
I'm still struggling with this - I wait for apt-maven-plugin to generate the Q classes, and then for the compiler to recompile them, even through they haven't changed. @timowest , you mentioned that the Q classes won't be re-generated if maven is running in incremental mode. Any idea how I can trigger incremental mode when running maven from the command line? Plugins like jaxb2-maven-plugin use a "staleFile" to determine when files should be regenerated without requiring that maven is running in incremental mode. |
This is not related to https://jira.codehaus.org/browse/MCOMPILER-209 - reverted back to 2.5.1 maven compiler, same thing as with 3.1 and useIncrementalCompilation set to false. By looking at your code, seems like buildContext.newScanner(directory, false) does not work as advertised. Thought to check whether it's up to plexus-utils. But it turns out I got versions 1.5.6, 1.5.8, 1.5.15, 2.0.5 and 2.0.6 in my maven repo. Yep, my app needs them all. Why, I don't know, it's maven wonders:) |
Still an issue - I run my applications locally with |
Is there any progress on this? Or a workaround? |
I found that the
plexus-build-api-0.0.7.jar BuildContext: /**
* Filesystem based non-incremental build context implementation which behaves as if all files
* were just created. More specifically,
*
* hasDelta returns <code>true</code> for all paths
* newScanner returns Scanner that scanns all files under provided basedir
* newDeletedScanner always returns empty scanner.
* isIncremental returns <code>false</code<
* getValue always returns <code>null</code>
*
* @plexus.component role="org.sonatype.plexus.build.incremental.BuildContext"
* role-hint="default"
*/
public class DefaultBuildContext implements BuildContext {
...
public boolean isIncremental() {
return false;
}
... |
This seems to work for me:
|
I seems that every time I run my maven build, the apt-maven-plugin is re-generating the source files that are later compiled. Unfortunately, this means that the compiler must compile those files even if the original source file is unchanged, adding to the build time.
Would it be possible to include a "staleness check", so that the QueryDSL source files are only re-generated if the relevant domain classes files have been modified?
This plugin seems to support something similar: http://mojo.codehaus.org/apt-maven-plugin/examples/configuring-staleness-checking.html
Thanks!
The text was updated successfully, but these errors were encountered: