Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] How to catch maven compilation errors in m2e plugin?

Do u pass in any exception instance when u call buildContext.addMessage() ?

IIRC, m2e is smart enough to ignore any build exceptions that were also attached to build context messages.

Vlad

On 7/22/2011 4:46 AM, Klaus Reimer wrote:
On 07/21/2011 08:07 PM, Igor Fedorenko wrote:
If you control the maven plugin, then BuildContext from susi-build-api
is the easiest way to associate problem markers with source files.
Yes, that works pretty well, thanks! Now I don't even need a m2e plugin.
Mapping the custom goals to the execute action is enough.

But one minor problem still exists: When I just add messages to the
build context then the command-line maven doesn't recognize this as a
build failure, so I have to throw a MojoExecutionException at the end
when a javascript error was detected. But inside Eclipse this always
creates an error marker in the pom.xml. Is there a way to avoid this?
Would be nice to just have error markers in the javascript files (The
BuildContext messages) but the command line maven must still report a
build failure when a javascript error occured.




Back to the top