You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sascha Vogt <sa...@gmail.com> on 2012/08/28 11:47:22 UTC

maven compiler plugin reports warnings as error

Hi all,

with the maven compiler plugin (version 2.5.1) and Maven 3.0.3 / 3.0.4 I
have the the strange effect, that if I have one real build error all
warnings are reported as errors as well.

Settings for the compiler plugin are (copied from the effective pom):
   <compilerArgument>-Xlint:all</compilerArgument>
   <showWarnings>true</showWarnings>
   <showDeprecation>true</showDeprecation>
   <compilerVersion>1.6</compilerVersion>
   <source>1.6</source>
   <target>1.6</target>

This makes it very hard to spot the real error. Is this the intended
behavior? I didn't find an issue regarding that.

Greetings
-Sascha-

PS: I did a quick check, and using the compiler plugin 2.3.1 only shows
the real error as error and the rest still as warning, though the output
seems to have changed quite a bit

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


Re: maven compiler plugin reports warnings as error

Posted by Sascha Vogt <sa...@gmail.com>.
Hi Wayne,

Am 29.08.2012 16:13, schrieb Wayne Fay:
>> I did a few more tests, see the output below. Should I open a ticket for
>> that?
> 
> What JDK are you using in each example?
I tried with 1.6.0_32 and 1.7.0_04, both 64-bit Version on Windows7 64-bit

> And yes, in general, if you think you have found a bug, you should
> open a ticket. It is especially nice if you can provide a patch to fix
> it as well. ;)
The question I had was more, if this is considered a bug, or if this
was/is intended behavior

Anyway, I created a Jira (http://jira.codehaus.org/browse/MCOMPILER-179)

Thx for the help
Greetings
-Sascha-

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


Re: maven compiler plugin reports warnings as error

Posted by Wayne Fay <wa...@gmail.com>.
> I did a few more tests, see the output below. Should I open a ticket for
> that?

What JDK are you using in each example?

And yes, in general, if you think you have found a bug, you should
open a ticket. It is especially nice if you can provide a patch to fix
it as well. ;)

Wayne

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


Re: maven compiler plugin reports warnings as error

Posted by Sascha Vogt <sa...@gmail.com>.
Hi again,

I did a few more tests, see the output below. Should I open a ticket for
that?

The output of 2.3.2 is
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING]
\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[19,18]
[unchecked] unchecked call to add(E) as a member of the raw type
java.util.List
[WARNING]
\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[20,18]
[unchecked] unchecked call to add(E) as a member of the raw type
java.util.List
[WARNING]
\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[24,15]
[unchecked] unchecked conversion
found   : java.util.List
required: java.util.List<java.lang.String>
[INFO] 3 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR]
\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[29,29]
getList() in de.maybebuggy.sample.Main cannot be applied to (int)
[INFO] 1 error
[INFO] -------------------------------------------------------------


As of 2.4 (and 2.5, 2.5.1) the output is:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] bad path element "": no such file or directory
C:\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[19,18]
[unchecked] unchecked call to add(E) as a member of the raw type
java.util.List
[ERROR]
C:\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[20,18]
[unchecked] unchecked call to add(E) as a member of the raw type
java.util.List
[ERROR]
C:\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[24,15]
[unchecked] unchecked conversion
found   : java.util.List
required: java.util.List<java.lang.String>
[ERROR]
C:\dev-tmp\sample\src\main\java\de\maybebuggy\sample\Main.java:[29,29]
getList() in de.maybebuggy.sample.Main cannot be applied to (int)
[INFO] 4 errors

Am 28.08.2012 11:47, schrieb Sascha Vogt:
> Hi all,
> 
> with the maven compiler plugin (version 2.5.1) and Maven 3.0.3 / 3.0.4 I
> have the the strange effect, that if I have one real build error all
> warnings are reported as errors as well.
> 
> Settings for the compiler plugin are (copied from the effective pom):
>    <compilerArgument>-Xlint:all</compilerArgument>
>    <showWarnings>true</showWarnings>
>    <showDeprecation>true</showDeprecation>
>    <compilerVersion>1.6</compilerVersion>
>    <source>1.6</source>
>    <target>1.6</target>
> 
> This makes it very hard to spot the real error. Is this the intended
> behavior? I didn't find an issue regarding that.
> 
> Greetings
> -Sascha-
> 
> PS: I did a quick check, and using the compiler plugin 2.3.1 only shows
> the real error as error and the rest still as warning, though the output
> seems to have changed quite a bit


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