FWIW, I started working on an API derived from the takari incremental
build. This is available at [1] with usage snippets available at [2].
But the API is much more complex that just a status flag but it would
allow automatically skipping any plugin work for which the inputs have
not changed at all.

[1] https://github.com/apache/maven/pull/1118
[2] 
https://github.com/gnodet/maven/blob/build-context/maven-core/src/test/java/org/apache/maven/internal/build/impl/Snippets.java

Le lun. 22 juil. 2024 à 18:53, Martin Desruisseaux
<martin.desruisse...@geomatys.com> a écrit :
>
> Hello again
>
> This is a side-effect of the work on maven-compiler-plugin. The
> "incremental build" mechanism is reviewed as a side-effect, for fixing
> MCOMPILER-209 [1] among others. When the compiler has detected that no
> source file, no dependency and no compiler option has changed, is there
> away to notify other plugins (in particular maven-surefire-plugin) so
> that they can skip e.g. tests if configured to do so?
>
> If there is no existing mechanism, could the
> org.apache.maven.api.plugin.Mojo interface be modified for returning an
> enumeration value instead of void? Maybe something like:
>
>     public interface Mojo {
>          enum Status {
>              EXECUTED,
>
>              UNCHANGED,
>
>              SKIPPED
>          }
>
>          Status execute();
>     }
>
> Together with some API, maybe in Session, telling what the previous
> plugins returned? For example, Surefire could skip the tests if all
> previous plugins (in particular the compiler plugin) returned
> Status.UNCHANGED. This behavior would be optional, through some
> configuration option.
>
>      Martin
>
> [1]https://issues.apache.org/jira/browse/MCOMPILER-209



-- 
------------------------
Guillaume Nodet

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to