Cannot change version of project facet Dynamic web module to 3.0

Posted 丁春秋

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cannot change version of project facet Dynamic web module to 3.0相关的知识,希望对你有一定的参考价值。

遇到这个问题,在网上找了各种方法,经过实际操作,下述方式能够解决此问题。

1.修改 web.xml

修改为:
<?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" xmlns:web="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" version="3.0">
</web-app>
2.Window>Show View>Navigator,在Navigator下打开项目的.settings目录下org.eclipse.jdt.core.prefs,修改为:

eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

3.打开org.eclipse.wst.common.component,修改为:

<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.8.0">
<wb-module deploy-name="storm">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/resources"/>
<property name="context-root" value="storm"/>
<property name="java-output-path" value="/storm/target/classes"/>
</wb-module>
</project-modules>

4.打开org.eclipse.wst.common.project.facet.core.xml,修改为:

<?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.8"/>
</faceted-project>

保存后,打开project facets,则问题消失。





























以上是关于Cannot change version of project facet Dynamic web module to 3.0的主要内容,如果未能解决你的问题,请参考以下文章

转解决Cannot change version of project facet Dynamic web module to 2.5

Cannot change version of project facet Dynamic Web Module to 3.1.

解决Cannot change version of project facet Dynamic web module to 3.0

解决Cannot change version of project facet Dynamic web module to 2.5

解决Cannot change version of project facet Dynamic web module to 2.5

解决Cannot change version of project facet Dynamic web module to 2.5