On 3 July 2012 10:25, Hilco Wijbenga <[email protected]> wrote:
> I have created a Maven extension that goes through the list of
> projects about to be built and eliminates the unnecessary ones. This
> is working fine. However, when running the same build twice (without
> source changes in between), all projects are removed which causes
> Maven to die with an error message.
>
> How can I cleanly (so with result SUCCESS) abort the build upon
> discovering no work needs to be done?

This does not appear to be possible.

For those interested, my workaround is to create a new, empty project
and supply only that project to Maven instead of the empty list.

final MavenProject dummyProject = new MavenProject();
dummyProject.setArtifactId("nothing");
dummyProject.setVersion("(everything is up-to-date).");

This then outputs

<snip/>
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building nothing (everything is up-to-date).
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
<snip/>

So not perfect but close enough. :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to