Maven項目常見錯誤解決方法彙總

issue 一、Java compiler level does not match the version of the installed Java project facet.

或者 One or more constraints have not been satisfied.apache

或者 Dynamic Web Module 3.1 requires Java 1.7 or newer.maven

解決辦法:ui

在項目中的pom.xml文件中添加如下配置:spa

 說明:如下是根據你本身使用的jdk版原本配置的,我本地使用的是jdk1.8,因此配置的是1.8code

<build>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>2.3.2</version>
              <configuration>
                  <source>1.8</source>
                  <target>1.8</target>
              </configuration>
           </plugin>
       </plugins>
</build>

以後選擇項目右鍵,選擇maven,而後選擇Update Maven Project更新一下項目就能夠了解決以上問題了。或者使用快捷鍵(ALT + F5)xml

相關文章
相關標籤/搜索