gnodet commented on PR #1143:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1143#issuecomment-6017567351

   > Just a clarification on the following:
   > 
   > > Notably, the annotation-processor path already defaults to 
rebuild-on-change — so the behavior was inconsistent: safe with processors, 
potentially unsafe without.
   > 
   > In my understanding, the rational for rebuilding all classes when 
annotation processing is present was not for safety. It is because annotation 
processor can collect information about annotated elements, and therefore may 
have incomplete information if we don't rebuild all. Example: a 
`@IncludeMeInSomeList` annotation and a processor which, after compilation, 
generates a file with all elements having this annotation. The processor needs 
all source files at compilation time even if these files are not impacted by 
any change. Even if we implemented an accurate tracking of dependencies 
("IDE-style incremental build"), we would still need to rebuild all files when 
an annotation processor is present.
   
   Yes, the only way is to have the annotation processors provide some 
meta-information about their processing and whether they are safe to not 
rebuild all.  This is what is implemented with 
https://github.com/apache/maven-compiler-plugin/blob/56e40dd958dac6a8e04ea511206000492aadb454/src/main/java/org/apache/maven/plugin/compiler/incremental/ProcessorType.java#L29.
   
   However, the main point is that I think this is wrong to provide a default 
behaviour which is unsafe in the default basic use case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to