You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jesse Farinacci <ji...@gmail.com> on 2013/01/23 15:31:47 UTC

custom extension problem, error mode enablement

Greetings

I'm seeing some odd behavior with a custom Apache Maven extension
intended to force on error message mode (-e). The extension can be
found here https://gist.github.com/63e65486e60124a3e8f7

The extension loads fine, and I see the log message found in the
extension, but it doesn't actually enable error message mode! I verify
error message mode is not enabled via the extension by causing an
error in a project, e.g. dependency on junit:junit:666, and observing
the difference with and without -e passed to mvn.

Would someone please tell me the magic incantation to programmatically
get error message mode enabled? It appears that setting
MavenExecutionRequest.setShowErrors(true) should do the trick, but
perhaps this is read once and never again, which occurs before the
extension gets loaded?

Any help is appreciated,
-Jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: custom extension problem, error mode enablement

Posted by Olivier Lamy <ol...@apache.org>.
Such extension are executing after projects read.
So if it's a model validation issue (as it looks to be your case) it's too late.
What you can try is to implement your own EventSpy
(http://maven.apache.org/ref/3.0.4/apidocs/org/apache/maven/eventspy/EventSpy.html
)
The first onEvent call is with MavenExecutionRequest before everything start.

2013/1/23 Jesse Farinacci <ji...@gmail.com>:
> Greetings
>
> I'm seeing some odd behavior with a custom Apache Maven extension
> intended to force on error message mode (-e). The extension can be
> found here https://gist.github.com/63e65486e60124a3e8f7
>
> The extension loads fine, and I see the log message found in the
> extension, but it doesn't actually enable error message mode! I verify
> error message mode is not enabled via the extension by causing an
> error in a project, e.g. dependency on junit:junit:666, and observing
> the difference with and without -e passed to mvn.
>
> Would someone please tell me the magic incantation to programmatically
> get error message mode enabled? It appears that setting
> MavenExecutionRequest.setShowErrors(true) should do the trick, but
> perhaps this is read once and never again, which occurs before the
> extension gets loaded?
>
> Any help is appreciated,
> -Jesse
>
> --
> There are 10 types of people in this world, those
> that can read binary and those that can not.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org