Skip to content

Provide easy way to convert all warnings into errors except specific #332

Open
@tatsiana-skurydzina-rovio

Description

Easy way to treat warnings as errors except specific type/s

Hi

I'm playing with the latest documentation 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 means 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions