1

I just set up a new project using maven 3. I added the following statement to my code:

    if(5==5){

    }

Which results in a comparing identical expressions warning in eclipse.

I use the following configuration for the maven-compiler-plugin:

        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>

            <configuration>
                <compilerArgument>-Xlint:unchecked</compilerArgument>
                <optimize>true</optimize>
                <showDeprecation>true</showDeprecation>
                <showWarnings>true</showWarnings>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>

But it refuses to show the warning.

What should I try next?

4

1 回答 1

2

Xlint您指定的参数将导致 javac 编译器警告未检查的泛型操作,但即使使用其他 -Xlint 选项,也无法从javac. 您需要配置您的构建以使用 Eclipse 编译器。有关如何使用非 javac 编译器的信息,请参阅 Maven 文档。

于 2013-07-09T12:05:16.167 回答