andPat
andPat

Reputation: 4522

Parse @Override annotation with maven compiler plugin

I've a maven project which doesn't parse @Override annotation, i.e. there are some @Override annotations missing in my project but when I run maven goal compile (with maven compiler plugin 3.1) it doesn't show me warning about missing @Override annotations, how can I set maven compiler plugin so that it shows warning about missing @Override annotations? here is my plugin:

<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
          <configuration>
            <source>1.6</source>
            <target>1.6</target>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <compilerArgument>-Xlint:unchecked</compilerArgument>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.6</version>
        </plugin>
        <plugin>

Upvotes: 3

Views: 615

Answers (1)

andPat
andPat

Reputation: 4522

I found the solution: only need to add these lines to maven compiler plugin configuration:

    <compilerArgs>
      <arg>-Xlint:rawtypes</arg>
      <arg>-Xlint:overrides</arg>
    </compilerArgs>

or, more generally:

-Xlint:all

as @fge suggesten correctly in a comment to question

Upvotes: 1

Related Questions