maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Ackermann (JIRA)" <j...@codehaus.org>
Subject [jira] Updated: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror
Date Sun, 13 Feb 2011 13:06:22 GMT

     [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Ackermann updated MCOMPILER-120:
---------------------------------------

    Attachment: trial-maven.zip

Attached example project. Just run "mvn compile". trial-maven-product-child logs a compiler
warning, but maven finishes with "Success".

Environment: Windows XP SP3, Maven 3.0.1, Maven Compiler Plugin 2.3.2, javac from jdk1.6.0_11.

The bug is critical for production builds: Builds with compiler warnings should not be used
in production.

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>         Attachments: trial-maven.zip
>
>
> 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: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message