Incremental build with RichFaces CDK
August 30, 2012
To whom of us using RichFaces CDK and being unsatisfied with a build time, our day just came!
CDK got an incremental build feature, which caches information collected during a Library compilation and store it on a hard drive.
Once you trigger a build for a second time, the last modification time of all sources is compared to last modification time of cache file.
When CDK recognizes that any source has changed, it will re-compile it and the collected data will be applied on Library model again, effectively rewriting old data.
How to Configure Incremental Build
How to configure incremental build in your CDK project? It’s pretty simple: you don’t need to do anything.
Incremental build is turned on by default to make your life easier and to save your precious time.
When using incremental build at current implementation, be aware that in some cases when you do structural changes (e.g. renaming methods), you may get to a point where the incrementally generated sources will not be valid – sometimes it won’t make any trouble (attribute renaming), sometimes sources generated by CDK might not be even compilable at all.
In this case, you just need to recompile the sources from scratch, either with additional maven-cdk-plugin configuration
$ mvn cdk:generate -Dcdk.recompile=true
or using command line interface:
$ bash run.sh --force-recompile
However in most cases, incremental build will work just fine. :-)