[ 
https://issues.apache.org/jira/browse/MCOMPILER-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16751997#comment-16751997
 ] 

Zalán Meggyesi commented on MCOMPILER-205:
------------------------------------------

Looking at [~rfscholte]'s comment
{quote}Looking at the code, you'll see that non-incremental will only look at 
changed sourcefiles. Incremental will also verifies if dependencies have 
changed and if files have been added or removed. If it has changed, it'll 
remove the complete classes-directory.
{quote}
I'm having second thoughts about this. I have a project of 2805 source files, 
and with the default parameters, running {{mvn compile}} twice in a row takes 
the same time, logging the compilation of 2085 files each time. On the other 
hand, by setting the parameter to false, the second compilation finishes much 
faster, compiling only three files. To be clear, I'm running the commands 
literally one after the other, so there is no way dependencies could have 
changed in the interim.

Reading Robert's comment, it seems to me that with the default incremental 
compilation enabled, running the same command twice immediately should produce 
an equally short run, since no dependencies have changed nor any files added or 
removed, which would preserve the classes directory and short-circuit the Java 
compiler.

Obviously, I'm misunderstanding _something_ - but what?

> maven-compiler-plugin: incremental compilation broken
> -----------------------------------------------------
>
>                 Key: MCOMPILER-205
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-205
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Lukas Fryc
>            Priority: Major
>         Attachments: hello.tgz, ignore-package-info.patch, 
> no-class-in-java-file.zip, only-recompile-changed.patch
>
>
> When we do {{clean}} -> {{compile}} -> {{compile}}, all Java sources are 
> re-compiled for second compilation steps:
> {code}
> [framework]$ mvn clean
> ...
> [framework]$ mvn compile
> ...
> [INFO] --- maven-compiler-plugin:3.1:compile (precompile-sources-for-cdk) @ 
> richfaces-framework ---
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 915 source files to 
> /mnt/workspace/workspaces/richfaces/richfaces5/framework/target/classes
> ...
> [framework]$ mvn compile
> ...
> [INFO] --- maven-compiler-plugin:3.1:compile (precompile-sources-for-cdk) @ 
> richfaces-framework ---
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 915 source files to 
> /mnt/workspace/workspaces/richfaces/richfaces5/framework/target/classes
> ...
> {code}
> The source code of the affected project: 
> https://github.com/richfaces/richfaces5/tree/077dcfc0a46d03d7ba9a7ac3e701a4adfb834c71



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to