Cannot change version of project facet Dynamic Web Module to 3.0?
来源:互联网 发布:mysql 配置用户名密码 编辑:程序博客网 时间:2024/06/05 15:09
转载:http://stackoverflow.com/questions/18122336/cannot-change-version-of-project-facet-dynamic-web-module-to-3-0
1.
This Problem With version right click on the project->properties->Project Facets->right click on Dynamic Web Module->unlock it-> uncheck->select 2.5 version->Apply->Update the maven
2.
This is a variation on pagurix's answer, but using Eclipse Mars.
Change your web.xml file to web.bak
Ignore the errors, we'll regenerate it next.
Go into project properties -> project facets and set the Dynamic Web Module version to what you need. Eclipse now allows you to save.
Now right-click on the project. Choose Java EE Tools -> Generate Deployment Descriptor Stub.
This creates a new web.xml with the required version.
Open the new web.xml and copy across the XML header and the complete web-app opening tag to your original web.bak, delete the new web.xml and rename web.bak back to web.xml.
Done.
3. 参考http://blog.csdn.net/penker_zhao/article/details/40589375
If you want to use version 3.1 you need to use the following schema:
- http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd
Note that 3.0 and 3.1 are different: in 3.1 there's no Sun mentioned, so simply changing 3_0.xsd to 3_1.xsd won't work
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"></web-app>
Also, make sure you're depending on the latest versions in your pom.xml. That is,
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> ... </configuration></plugin>
and
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope></dependency>
Also, you should compile with Java 7 or 8:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration></plugin>
- Maven web项目报异常:Cannot change version of project facet Dynamic Web Module to 3.0.
- 异常——(4)Cannot change version of project facet Dynamic Web Module to 3.0
- cannot change version of project facet dynamic web module to 3.0异常修复
- Eclipse EE Cannot change version of project facet Dynamic web module to 3.0
- 解决Cannot change version of project facet Dynamic web module to 3.0
- Maven下解决Cannot change version of project facet Dynamic Web module to 3.0
- ERROR: Cannot change version of project facet Dynamic Web Module to 3.0?
- 解决Cannot change version of project facet Dynamic web module to 3.0
- Cannot change version of project facet Dynamic Web Module to 3.0
- Cannot change version of project facet Dynamic Web Module to 3.0.
- Cannot change version of project facet Dynamic web module to 3.0 解决方案
- 错误Cannot change version of project facet Dynamic Web Module to 3.0
- Cannot change version of project facet Dynamic Web Module to 3.0?
- Cannot change version of project facet Dynamic Web Module to 3.0.
- 解决Cannot change version of project facet Dynamic web module to 3.0
- Cannot change version of project facet Dynamic Web Module to 2.5.或者3.0
- Cannot change version of project facet Dynamic Web Module to 2.5(3.0)
- 解决Cannot change version of project facet Dynamic web module to 3.0
- Android5.0新特性-Material Design
- 拓扑排序
- Android onActivityResult获取返回值的方法
- Apache 2.4.18-x64-vc11 配置
- NS3回调问题
- Cannot change version of project facet Dynamic Web Module to 3.0?
- Android 65K问题之65K来源探究
- Windows应用程序的面向对象特性 之 封装
- 如何理解数据结构中的引用参数 &
- 重写的基本要求
- 给 Android 开发者的 RxJava 详解
- 【灵性的觉醒】做自己人生剧的导演
- 什么是堆和栈,它们在哪儿?
- qt5.5.1的程序发布方法