maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Ioffe (JIRA)" <>
Subject [jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror
Date Mon, 06 Jun 2011 22:42:22 GMT


Alex Ioffe commented on MCOMPILER-120:

Just a little clarification, in the inner pom ( file you
will see an entry for plexus-compiler-javac version '1.8.2-SNAPSHOT'. In order to run the
integration test, go to the outer pom file ( and run 'mvn test' which will
run the integration test.
This integration test does nothing more then call 'mvn compile' on the inner pom file and
then checks the output/return code of it. In order to successfully pass the test, the inner
pom file should fail the build and have a return code 1.
In order to have this integration test pass, you have to get the code for plexus-compiler-javac
(svn info here:, make the
code change to the JavacCompiler, and then deploy it to a local repo. The inner pom file will
pick it up, the inner build will fail, and the integration test will pass.

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>                 Key: MCOMPILER-120
>                 URL:
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>         Attachments:, JavacCompiler.patch,,
> If I write a pom file like the following:
> ...
> <plugin>
>   			<groupId>org.apache.maven.plugins</groupId>
>   			<artifactId>maven-compiler-plugin</artifactId>
>   			<version>2.1</version>
>   			<configuration>
>   			    <compilerId>javac</compilerId>
>   				<source>1.6</source>
>   				<target>1.6</target>
>   				<compilerArguments>
>   					<Werror /> 
>   					<Xlint:all />
>   				</compilerArguments>
>   				<showDeprecation>true</showDeprecation>
>   			</configuration>
>   		</plugin>
> and if there are only warnings, then the build will not fail as intended by the compiler
Argument. The reason is that in compileInProcess the exit code from javac is only considered
if there are no messages. In the case of treating warnings as errors, there will be messages
but no errors so the intention of the build failure is lost. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message