1.Error: cannot change version of project facet dynamic web module to 3.0java
1.1 修改web.xmlweb
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>Servlet 3.0 Web Application</display-name> </web-app>
1.2 找到工程目錄,修改.setting/org.eclipse.wst.common.project.facet.core.xml文件apache
<?xml version="1.0" encoding="UTF-8"?> <faceted-project> <fixed facet="wst.jsdt.web"/> <installed facet="jst.web" version="3.0"/> <installed facet="wst.jsdt.web" version="1.0"/> <installed facet="java" version="1.7"/> <installed facet="jst.jsf" version="2.2"/> <installed facet="jst.jaxrs" version="2.0"/> </faceted-project>
直接手動修改jst.web對應的version便可。app
而後,項目右鍵-->Maven-->Update Projecteclipse
2.Error: JavaServer Faces 2.2 can not be installed : One or more constraints have not been satisfiedmaven
修改web.xml文件ui
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>Servlet 3.0 Web Application</display-name> </web-app>
3.Error: JAX-RS (REST Web Services) 2.0 can not be installed : One or more constraints have not been satisfiedspa
修改pom.xml文件,在<build>中加入以下語句。code
<build> <finalName>mvntest</finalName> <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>
以上問題常常同時出現,暴力一點,把文件都改了,就沒問題了。至於問題出現的緣由,尚未深層的追究,但願各位大神能指點一下。xml