maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aliaksei Lahachou <aliaksei.lahac...@gmail.com>
Subject Re: Compiler warnings treated as errors
Date Mon, 29 Jul 2013 07:19:39 GMT
I debugged the compiler plugin and found the problem. The output from the
javac compiler is the following:

--- BEGIN LOG ---
<...>\ImageCaptchaServlet.java:14: warning:
com.sun.image.codec.jpeg.JPEGCodec is Sun proprietary API and may be
removed in a future release
import com.sun.image.codec.jpeg.JPEGCodec;
                               ^
<...>\ImageCaptchaServlet.java:15: warning:
com.sun.image.codec.jpeg.JPEGImageEncoder is Sun proprietary API and may be
removed in a future release
import com.sun.image.codec.jpeg.JPEGImageEncoder;
                               ^
An exception has occurred in the compiler (1.6.0_45). Please file a bug at
the Java Developer Connection (http://java.sun.com/webapps/bugreport)
after checking the Bug Parade for duplicates. Include your program and the
following diagnostic in your report.  Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for
javax.persistence.GenerationType not found
--- END LOG ---

So the compiler did fail, but the JavacCompiler.parseModernStream failed to
parse the last message, it returned a list with 2 elements for the first 2
warnings. The error message was nowhere in m-compiler-p output, which is
also strange, because I've seen this message in other modules, and I know
this error very well.

Compiler plugin finishes successfully, after I added API dependencies to
the POM.

Regards,
htfv (Aliaksei Lahachou)



On Sat, Jul 27, 2013 at 8:46 AM, Anders Hammar <anders@hammar.net> wrote:

> > And why does it think, that compilation failed? The same source is
> > successfully compiled by the compiler plugin 2.3.2. It could be also
> > compiled successfully in another module with 2.5.1 and 3.1. The compiler
> > source and target are set to 1.5.
> >
>
> I don't know. You need to debug.
>
> /Anders
>
>
> >
> >
> > On Wed, Jul 24, 2013 at 12:14 PM, Anders Hammar <anders@hammar.net>
> wrote:
> >
> > > > 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