At every file change, Maven does recompile the whole 1337 source files, which takes a while, makes my laptop take off and swap 😕
Is there a way to improve this?
With ant, it sometimes was necessary to ant clean but compilation was much faster (yet the longest task was creating the .jar).
Or maybe there is a fast path for compiling a new extension, aside from the global build and running tests with requir'ing the extension dynamically?
if I take an older version of the maven-compiler-plugin 2.5.1 then it just recompiles the changed files as I would expect it from incremental compilation. BUT I do not get the bootclasspath for jruby configured :(
hope there is a solution . . .
3f93c50 should get a nice incremental compilation with maven. hope that keeps your laptop away from using the swap ;)
does not work :(
Sigh. So I spent a couple hours trying to solve this...playing with compiler flags, trying different compiler plugins (two based on Eclipse's JDT and one based on Scala's SBT), reading articles about how javac doesn't actually do incremental compilation and "ant" just fakes it. Nothing worked.
Until I read the code associated with maven-compiler-plugin's "useIncrementalCompilation" flag. The logic here seems reversed; Incremental compilation appeared to always forcibly recompiling everything if any source changes. The false path, incremental compilation turned off, gathered a list of recently-modified source files and only compiled those.
So, on a hunch, I set useIncrementalCompilation to false. Bingo...incremental builds. If I touch a file now, only that files is rebuilt.
There's a chance this will not be acceptable. It probably won't recompile dependent files, resulting in them failing at runtime (when we move on from editing to testing and debugging). But I don't think that's any different from e.g. ant's "incremental" logic, and if we're using IDEs to refactor, ideally all statically-referencing dependencies should get updated together.
We'll run with this for a while and see how it goes.
Fixed in 37ce7da
Seems to work at me, thanks!