3 ms·
It's been a while since I used maven but if I recall correctly the reason for that is that javac (java compiler) actually doesn't do incremental compilation. It
by jvmboi 3y ago
It's been a while since I used maven but if I recall correctly the reason for that is that javac (java compiler) actually doesn't do incremental compilation. It was such a problem that eclipse (the ide) had it's own java compiler that could do incremental compilation. This alternative compiler was so popular that you could even use it in Jetbrains IDE and I think you could configure maven to use it to get incremental compilation there to.
- akoboldfrying 3y agoEclipse's own compiler is (impressively!) able to do truly incremental compilation: compiling the syntactically correct subset of methods in source files that aren't fully syntactically correct, and not bothering to recompile untouched methods. javac will compile every file you tell it to, plus any out-of-date immediate dependencies (and their out-of-date immediate dependencies, and so on, recursively), but if A uses B which uses C and you change C.java only, `javac A.java` doesn't "see" that all 3 need recompilation. Maven doesn't even offer javac's incomplete dependency checking by default, though I believe it can be forced to. (0.5 points for correctness over efficiency, I suppose.)