- 基本有這些類型:
Cannot change version of project facet Dynamic Web Module to 3.0.
Java compiler level does not match the version of the installed Java project facet.
One or more constraints have not been satisfied.
Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.
Dynamic Web Module 3.0 requires Java 1.6 or newer.
Java compiler level does not match the version of the installed Java project face
是maven項目在eclipse里以web項目部署出錯,轉(zhuǎn)化版本失敗茫打。Dynamic Web Module版本不對居触,或者java版本不對。在這個時候包吝,據(jù)查閱饼煞,只需要改3個地方就可以完美解決這個問題。
-
eclipse中打開Navigator文檔模式诗越,在windows--show view--Navigator
image.png
image.png
- 修改web.xml,src/main/webapp/WEB-INF/web.xml息堂,修改Dynamic Web Module版本嚷狞。
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="schedule-console" version="3.0">
<display-name>Archetype Created Web Application</display-name>
</web-app>
- 修改pom.xml文件,在bulid里添加java版本依賴荣堰。
<build>
<finalName>contentplatform</finalName>
<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 project...床未。這個時候基本都會沒問題了。有也是小問題振坚,繼續(xù)修改下java配置即可薇搁。