You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "tatsiana-skurydzina-rovio (via GitHub)" <gi...@apache.org> on 2025/05/30 16:47:32 UTC

[I] Provide easy way to convert all warnings into errors except specific [maven-compiler-plugin]

tatsiana-skurydzina-rovio opened a new issue, #332:
URL: https://github.com/apache/maven-compiler-plugin/issues/332

   ### New feature, improvement proposal
   
   Hi
   
   I'm playing with [the latest documentation](https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#parameters) and source code for maven-compiler-plugin for a couple of hours but I cannot find the proper way to achieve what I want. It mean I either missing something in the doc or it's missing.
   
   My goal to achieve the following behaviour with maven-compiler-plugin: fail build on warnings, treat them as errors except usage of deprecated annotation.
   
   ```
   <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-compiler-plugin</artifactId>
             <version>3.14.0</version>
             <configuration>
                 <source>17</source>
                 <release>17</release>
                 <parameters>true</parameters>
                 <compilerArgs>
                     <arg>-Xlint:all</arg>
                     <arg>-Xlint:-deprecation</arg>
                     <arg>-Werror</arg>
                 </compilerArgs>
             <configuration>
    </plugin>
   ```
   It seems the most straightforward  but it doesn't compile and other combinations with `showDeprecation`.
   
   Did I miss something obvious or there is no way to archive such behaviour?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Provide easy way to convert all warnings into errors except specific [maven-compiler-plugin]

Posted by "archiecobbs (via GitHub)" <gi...@apache.org>.
archiecobbs commented on issue #332:
URL: https://github.com/apache/maven-compiler-plugin/issues/332#issuecomment-4445538345

   FYI, this is possible now in JDK 26+ using the `-Werror` flag.
   
   ```
   $ javac --help
   ...
     -Werror                      Terminate compilation if any warnings occur
     -Werror:<key>(,<key>)*
           Specify lint categories for which warnings should terminate compilation,
           separated by comma.
           Precede a key by '-' to exclude the specified category.
           Use --help-lint to see the supported keys.
   ```
   
   Caveat: [there is a bug](https://bugs.openjdk.org/browse/JDK-8349847) in the implementation that will be fixed in 27.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Provide easy way to convert all warnings into errors except specific [maven-compiler-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo closed issue #332: Provide easy way to convert all warnings into errors except specific
URL: https://github.com/apache/maven-compiler-plugin/issues/332


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Provide easy way to convert all warnings into errors except specific [maven-compiler-plugin]

Posted by "elharo (via GitHub)" <gi...@apache.org>.
elharo commented on issue #332:
URL: https://github.com/apache/maven-compiler-plugin/issues/332#issuecomment-5454795245

   This seems like it belongs in the compiler itself rather than the compiler plugin and will eventually be fixed there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org