简体   繁体   中英

Maven compiler warnings and errors in Eclipse

I already asked the opposite question but now I'm growing fond of Maven and would like to set compiler warnings in my pom that are actually mapped to the eclipse project, enabling eclipse to mark "wrong" lines with warnings.

I think(?) Maven already sets the tick to overwrite the default warnings per project, but then just copies the default values into the non default settings. Then it shouldn't be a big hasle for a plugin to eg set "Member can be static" to warn?

Which is the write plugin? I can't the the compiler plugin to have any options for this.

Not sure I fully understand your question. For the warnings bit, you can override it using the showWarnings entity in the maven compiler plugin:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
            <encoding>${project.build.sourceEncoding}</encoding>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
        </configuration>
    </plugin>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM