maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aliaksei Lahachou <>
Subject Compiler warnings treated as errors
Date Wed, 24 Jul 2013 08:48:53 GMT
Hello all,

I think this problem was already discussed here, but I cannot find it. My
problem is that sometimes compiler warnings are treated as errors. For

[ERROR] Failed to execute goal
(default-compile) on project <...>: Compilation failure: Compilation
[ERROR] <...>\[14,31]
com.sun.image.codec.jpeg.JPEGCodec is Sun proprietary API and may be
removed in a future release
[ERROR] <...>\[15,31]
com.sun.image.codec.jpeg.JPEGImageEncoder is Sun proprietary API and may be
removed in a future release

This is not a problem with m-compiler-p version 2.3.2, but it is a problem
in all newer versions (I tried 2.4, 2.5, 2.5.1, 3.0, 3.1).

This behavior seems to be unstable. The source from the example was
compiled successfully, when they were a part of other Maven module. When I
moved it to another module after refactoring, I could not compile it any
more. Both modules are inherited from the same parent and have the same
m-compiler-p configuration (I also compared effective POMs).

I tried building trunk version of m-compiler-p. There, the
CompilerMojoTestCase.testCompilerFork test fails, and it seems to me for
the same reason:

Time elapsed: 0.09 sec  <<< ERROR!
org.apache.maven.plugin.compiler.CompilationFailureException: Compilation

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 );
                throw new CompilationFailureException( warnings );

My environment is Windows 7 x64, Oracle JDK 1.6.0_45.

Is this a known problem? Is there a workaround for it? (other than using
version 2.3.2 version of m-compiler-p)

htfv (Aliaksei Lahachou)

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