I have few Eclipse Java Projects and I converted them into Maven. All the projects are showing errors where interface methods are overwritten. But I when I run "mvn clean" it does show as build success. Also when I remove the maven nature, the projects compile without an issue. Why is this happening? Please advice.
This is most likely due to your pom missing a specification of which Java version you are targeting; JDK versions prior to 1.6 didn't allow the @Override
annotation on methods that implemented interface methods. You should always specify he Java version so Maven doesn't have to guess what you intend. For example:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
When you tell maven to configure your Eclipse Project or import it via m2e, it looks for that configuration to apply to corresponding configuration in Eclipse. If the version is absent, it uses whatever is the default for your workspace, which can vary between workspaces. You probably are running into that, where it's guessed wrong.
You can manually fix the project config in Eclipse, too; see https://stackoverflow.com/a/1678170/639520
But fixing the pom is a good idea anyway and then refreshing/updating the Eclipse config should pick it up.