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

Liwae Lamaa commented on MCOMPILER-278:
---------------------------------------

If we follow exactly what the description of -MCOMPILER-349- suggests, the 
recompilation of A after a change in B (and failure of A in case of a breaking 
change in B) is not currently happening with the fix provided by MCOMPILER-349.

On the other hand, the fix provided in the patch 
maven-compiler-plugin-3.1.patch here introduced the behavior needed:
If at any time B interface changed, A would be able to detect this change 
(based on jar timestamp) and recompile.

Attached is a sample project ( sampleProject.zip ) that illustrates the case:
- A depend on B
- Change B's printB(int ciao) method to printB(int ciao, int hi)
- run mvn clean install on B
- run mvn compile on A still using printB(int ciao)
- we expect A compilation to fail.

Thanks.

> Incremental build does not track inter-module dependencies.
> -----------------------------------------------------------
>
>                 Key: MCOMPILER-278
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-278
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Michael Zav'yalov
>            Priority: Major
>         Attachments: maven-compiler-checksum.patch, 
> maven-compiler-plugin-3.1.patch, sampleProject.zip
>
>
> When useIncrementalCompilation=true the plugin actually assumes that this 
> incremental compilation is supported by compiler itself (I state it because 
> of all source files are always sent to compiler).
> But plugin provides an additional optimization - it can detect that there are 
> no changes at all, so calling compiler can be skipped. It is especially 
> critical for javac that does not support incremental build since 1.3.
> Unfortunately, plugin ignores claspath dependencies that are not directory, 
> i.e. - jars, so when dependent jar is modified (in incompatible way) - our 
> project is not re-compiled.



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

Reply via email to