Hi folks!

I need a bit feedback about forcing mojo execution in incremental builds [1].

As already explained, the main problem in this area is that some plugins (e.g. 
maven-compiler-plugin) already have some kind of incremental build logic, but 
do this way too lazily (see 'Rational' in the linked wiki page). This can get 
fixed easily for the maven-compiler-plugin, but for other plugin e.g. the 
maven-surefire-plugin things become a bit more complicated.


Why would we like to have an incremental build for the surefire-maven-plugin at 
all?

Think about a multi-module EAR project with 7 web applications and a few 
utility/backend modules. If you change only one file in a single webapp, then 
the tests of the other webapps do not need to run again. The 2 general rules of 
incremental builds apply straight forward. The tests only need to run in a 
module if either a previous build step produced/changed a result that is an 
input parameter for this build, or if the dependencies of the module changed. 

But there is still the case where a user might force the plugin execution like

$> mvn surefire:run

or 

$> mvn test

If the maven-surefire-plugin would implement the incremental build rules, it 
would just do nothing on the second invocation (as no input parameter did 
change).
Now one could argue that you can simply use the clean phase, but then all the 
upfront processing would get performed as well. Do we like that? This might be 
annoying if you only like to run a single test via the -Dtest= parameter. Or 
just like to trigger a debugging session with -Dmaven.surefire.debug


In that case some parameter to suppress the incremental build behaviour would 
be handy.

Now this can be done in 2 ways: enable incremental builds by default or 
disabled by default.
Or is the surefire-plugin an exceptional case and we can just add a 
'forceExecution' flag directly to the maven-surefire-plugin?


We could also define that the incremental build is enabled if phases get 
specified, but if you specify a distinct plugin target, then it's execution 
should get forced. In any case we need to extend maven-core a bit. And in the 
best case in a way which allows the plugins to run fine on old maven versions 
as well.


Any ideas how we could implement this? 


Of course, first we need a clear idea how a user should interact with that. 
After that we can look at how to hack it.


txs and LieGrue,
strub

[1] https://cwiki.apache.org/confluence/display/MAVEN/Incremental+Builds


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

Reply via email to