Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1
-
Fix Version/s: 2.4
-
Labels:None
-
Number of attachments :
Description
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.
Issue Links
- relates to
-
MCOMPILER-179
Warnings
-
Activity
Martin Ackermann
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | trial-maven.zip [ 53702 ] |
Alex Ioffe
made changes -
| Attachment | JavacCompiler.java [ 55141 ] |
Alex Ioffe
made changes -
| Attachment | JavacCompiler.patch [ 55142 ] |
Alex Ioffe
made changes -
| Attachment | werror.zip [ 55436 ] |
Kristian Rosenvold
made changes -
| Status | Open [ 1 ] | Closed [ 6 ] |
| Assignee | Kristian Rosenvold [ krosenvold ] | |
| Fix Version/s | 2.4 [ 16208 ] | |
| Resolution | Fixed [ 1 ] |
Herve Boutemy
made changes -
| Description |
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. |
If I write a pom file like the following:
{code:xml}... <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>{code} 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. |
Kristian Rosenvold
made changes -
| Link |
This issue relates to |
Anders Hammar
made changes -
| Comment |
[ I think that my fix on plexus-compiler for |