maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Compiler warnings treated as errors
Date Wed, 24 Jul 2013 10:14:07 GMT
> The following code seems a bit strange to me. Why does it throw a
> compilation failure exception when there are warnings?
>
>             if ( !errors.isEmpty() )
>             {
>                 throw new CompilationFailureException( errors );
>             }
>             else
>             {
>                 throw new CompilationFailureException( warnings );
>             }
>

It's due to the wrapping if clause you're not quoting:

if ( failOnError && !compilerResult.isSuccess() )

The compilation has failed as indicated by !compilerResult.isSuccess().

/Anders

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message