Maven项目提示@Override is not allowed when implement interface method

  • 发布于2019-04-15
  • 88 人围观
这是Maven项目遇到的问题。Intellij IDEA和Eclipse下都会遇到这个问题。




maven类型项目,所以在pox.xml的<build></build>标签中添加如下代码,即可解决问题。

<properties>
        <jdk.version>1.7</jdk.version>
        <!-- 强制编码 -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
   ...
<plugins>
    <!-- compiler插件, 设定JDK版本 -->
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>${jdk.version}</source>
            <target>${jdk.version}</target>
            <showWarnings>true</showWarnings>
            <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
    </plugin>
</plugins>


标签:
关键词: