API could - theorically you can use a flag in the session already....but
you must not skip surefire is compiler execution is skipped.
Surefire has its own inputs and even if the overlap with compiler can be
important it is also far to be 1-1 so you skip surefire if nothing changed
for surefire not a random other plugin (surefire can have custom paths,
must consider the env, props etc...).
A shared "did this artifact/folder changed" tool with a shared hash per
execution can be a good way like in the build extension we have but no
shortcut please until you do a new surefire which does not support all
current use cases.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


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
>

Reply via email to