You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christopher Webster (JIRA)" <ji...@codehaus.org> on 2010/03/22 19:28:22 UTC

[jira] Created: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

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


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

        

[jira] Issue Comment Edited: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Steven Schlansker (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281147#comment-281147 ] 

Steven Schlansker edited comment on MCOMPILER-120 at 10/12/11 12:20 PM:
------------------------------------------------------------------------

Thank you, I had to do this actually:

{code}
                    <!-- Remove after we move to maven-compiler-plugin 2.4 -->
                    <dependencies>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-api</artifactId>
                        <version>1.8.2</version>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-manager</artifactId>
                        <version>1.8.2</version>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac</artifactId>
                        <version>1.8.2</version>
                        <scope>runtime</scope>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                    </dependencies>
{code}

but it does work now!

      was (Author: stevenschlansker):
    Thank you, I had to do this actually:

                    <!-- Remove after we move to maven-compiler-plugin 2.4 -->
                    <dependencies>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-api</artifactId>
                        <version>1.8.2</version>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-manager</artifactId>
                        <version>1.8.2</version>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac</artifactId>
                        <version>1.8.2</version>
                        <scope>runtime</scope>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                    </dependencies>


but it does work now!
  
> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Alex Ioffe (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269751#action_269751 ] 

Alex Ioffe commented on MCOMPILER-120:
--------------------------------------

Thanks a lot guys. This will really help.

> 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
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.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

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Alex Ioffe (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269662#action_269662 ] 

Alex Ioffe commented on MCOMPILER-120:
--------------------------------------

This does not directly stem from maven-compiler-plugin, it has to do with the plexus-compiler-javac and it does effect the latest version of it (1.8.1 etc...). If you take a look at werror.zip/warningsbuild/pom.xml you will see a explicit dependency plexus-compiler-javac under maven-compiler-plugin.

> 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: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.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

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Steven Schlansker (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=280688#comment-280688 ] 

Steven Schlansker commented on MCOMPILER-120:
---------------------------------------------

Ref: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-compiler/1.8.2/plexus-compiler-1.8.2.pom

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Steven Schlansker (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281100#comment-281100 ] 

Steven Schlansker commented on MCOMPILER-120:
---------------------------------------------

I've sent a mail to the plexus compiler user list in the hopes that there are in fact additional issues fixed worthy of a new release.

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269728#action_269728 ] 

Kristian Rosenvold commented on MCOMPILER-120:
----------------------------------------------

Plexus compiler fixed in 633f437fc9fa52aab00da8b7fe7fbf09c93f7219. 1.8.2 will be on central shortly.

> 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: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.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

        

[jira] Issue Comment Edited: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281113#comment-281113 ] 

Kristian Rosenvold edited comment on MCOMPILER-120 at 10/12/11 1:38 AM:
------------------------------------------------------------------------

You can add plexus-compiler manually to maven-compiler-plugin

{code}
         <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <dependencies>
                    <dependency>rg.ap
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler</artifactId>
                        <version>1.8.2</version>
                    </dependency>
                </dependencies>
            </plugin>
{code}

      was (Author: krosenvold):
    You can add plexus-compiler manually to maven-compiler-plugin

         <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <dependencies>
                    <dependency>rg.ap
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler</artifactId>
                        <version>1.8.2</version>
                    </dependency>
                </dependencies>
            </plugin>

  
> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MCOMPILER-120:
------------------------------------

    Description: 
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. 


  was:
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. 



> 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
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Anders Hammar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269245#action_269245 ] 

Anders Hammar commented on MCOMPILER-120:
-----------------------------------------

I think there should be an IT as well to get this applied.

> 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: JavacCompiler.java, JavacCompiler.patch, 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

        

[jira] Closed: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Rosenvold closed MCOMPILER-120.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.4
         Assignee: Kristian Rosenvold

compiler plugin fixed in r1133088

Integration test based on test project supplied by Martin Ackermann, added to the standard maven-invoker based IT suite.

> 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
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.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

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269656#action_269656 ] 

Kristian Rosenvold commented on MCOMPILER-120:
----------------------------------------------

Does this bug actually affect the latest version of the compiler plugin ? I seem to have trouble reproducing it on 2.3.2...?

> 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: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.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

        

[jira] Issue Comment Edited: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281113#comment-281113 ] 

Kristian Rosenvold edited comment on MCOMPILER-120 at 10/12/11 1:38 AM:
------------------------------------------------------------------------

You can add plexus-compiler manually to maven-compiler-plugin

{code}
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler</artifactId>
                        <version>1.8.2</version>
                    </dependency>
                </dependencies>
            </plugin>
{code}

      was (Author: krosenvold):
    You can add plexus-compiler manually to maven-compiler-plugin

{code}
         <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <dependencies>
                    <dependency>rg.ap
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler</artifactId>
                        <version>1.8.2</version>
                    </dependency>
                </dependencies>
            </plugin>
{code}
  
> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Alex Ioffe (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Ioffe updated MCOMPILER-120:
---------------------------------

    Attachment: werror.zip

Okay guys... here's your integration test. Its a simple JUnit module called 'WerrorTest.java'  which uses MavenCli to call the 'compile' command on the inner module and checks that the maven output (of this invocation) contains a "unchecked call to add(e)" and has a return code 1. If these conditions are met, the unit test passes.

> 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: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.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

        

[jira] (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Anders Hammar (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=311202#comment-311202 ] 

Anders Hammar commented on MCOMPILER-120:
-----------------------------------------

I think that my fix on plexus-compiler for MCOMPILER-160 fixes this issue as well. BUT, it's a band-aid fix of the code not being able to parse things correctly.
                
> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Wendy Smoak (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269389#action_269389 ] 

Wendy Smoak commented on MCOMPILER-120:
---------------------------------------

There's already a sample project attached.  Are there some docs available on how to turn it into an integration test?

> 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: JavacCompiler.java, JavacCompiler.patch, 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

        

[jira] Updated: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Alex Ioffe (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Ioffe updated MCOMPILER-120:
---------------------------------

    Attachment: JavacCompiler.java

I think the fix is trivial, in 'parseModernError' switch the order of:
isError = exitCode != 0;

and:
// Remove the 'warning: ' prefix
String warnPrefix = getWarnPrefix( msg );
if ( warnPrefix != null )
{
    isError = false;
    msg = msg.substring( warnPrefix.length() );
}

... and then it works as expected.

> 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: JavacCompiler.java, 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

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Alex Ioffe (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269664#action_269664 ] 

Alex Ioffe commented on MCOMPILER-120:
--------------------------------------

Just a little clarification, in the inner pom (werror.zip/warningsbuild/pom.xml) 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 (werror.zip/pom.xml) 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: http://plexus.codehaus.org/plexus-utils/source-repository.html), 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: http://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.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

        

[jira] Updated: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Martin Ackermann (JIRA)" <ji...@codehaus.org>.
     [ 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

        

[jira] Updated: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Alex Ioffe (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Ioffe updated MCOMPILER-120:
---------------------------------

    Attachment: JavacCompiler.patch

here's a patch

> 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: JavacCompiler.java, JavacCompiler.patch, 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

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Steven Schlansker (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=280687#comment-280687 ] 

Steven Schlansker commented on MCOMPILER-120:
---------------------------------------------

Kristian commented above that the Plexus compiler was fixed and that 1.8.2 was released... I can confirm that I see 1.8.2 on various Maven mirrors.  Is that not sufficient?  (Sorry, I don't know too much about the dependencies here, I just want to offer to go bug whoever is blocking this from getting out so I can use it!)

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281113#comment-281113 ] 

Kristian Rosenvold commented on MCOMPILER-120:
----------------------------------------------

You can add plexus-compiler manually to maven-compiler-plugin

         <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <dependencies>
                    <dependency>rg.ap
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler</artifactId>
                        <version>1.8.2</version>
                    </dependency>
                </dependencies>
            </plugin>


> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=280686#comment-280686 ] 

Robert Scholte commented on MCOMPILER-120:
------------------------------------------

It's not that hard, but we've provided some other patches for the plexus-compiler-javac. Would be nice if that one is released first before releasing the next m-compiler-p.

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Steven Schlansker (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=280544#comment-280544 ] 

Steven Schlansker commented on MCOMPILER-120:
---------------------------------------------

It seems that maven-compiler-plugin 2.4 still hasn't been released... I don't suppose that it's easy to do that?  I'd love to use this bug fix but I don't want to maintain my own build unless I have to :-)

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Anders Hammar (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anders Hammar updated MCOMPILER-120:
------------------------------------

    Comment: was deleted

(was: I think that my fix on plexus-compiler for MCOMPILER-160 fixes this issue as well. BUT, it's a band-aid fix of the code not being able to parse things correctly.)
    
> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-120) Javac compiler plugin doesn't support -Werror

Posted by "Steven Schlansker (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=281147#comment-281147 ] 

Steven Schlansker commented on MCOMPILER-120:
---------------------------------------------

Thank you, I had to do this actually:

                    <!-- Remove after we move to maven-compiler-plugin 2.4 -->
                    <dependencies>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-api</artifactId>
                        <version>1.8.2</version>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-manager</artifactId>
                        <version>1.8.2</version>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                      <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac</artifactId>
                        <version>1.8.2</version>
                        <scope>runtime</scope>
                        <exclusions>
                          <exclusion>
                            <groupId>org.codehaus.plexus</groupId>
                            <artifactId>plexus-component-api</artifactId>
                          </exclusion>
                        </exclusions>
                      </dependency>
                    </dependencies>


but it does work now!

> Javac compiler plugin doesn't support -Werror
> ---------------------------------------------
>
>                 Key: MCOMPILER-120
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-120
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Christopher Webster
>            Assignee: Kristian Rosenvold
>             Fix For: 2.4
>
>         Attachments: JavacCompiler.java, JavacCompiler.patch, trial-maven.zip, werror.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira