Maven创建web工程报错
2016-03-05 18:55
232 查看
1.Error: cannot change version of project facet dynamic web module to 3.0
1.1 修改web.xml
1.2 找到工程目录,修改.setting/org.eclipse.wst.common.project.facet.core.xml文件
直接手动修改jst.web对应的version即可。
然后,项目右键-->Maven-->Update Project
2.Error: JavaServer Faces 2.2 can not be installed : One or more constraints have not been satisfied
修改web.xml文件
3.Error: JAX-RS (REST Web Services) 2.0 can not be installed : One or more constraints have not been satisfied
修改pom.xml文件,在<build>中加入如下语句。
以上问题经常同时出现,暴力一点,把文件都改了,就没问题了。至于问题出现的原因,还没有深层的追究,希望各位大神能指点一下。
1.1 修改web.xml
<?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文件
<?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即可。
然后,项目右键-->Maven-->Update Project
2.Error: JavaServer Faces 2.2 can not be installed : One or more constraints have not been satisfied
修改web.xml文件
<?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 satisfied
修改pom.xml文件,在<build>中加入如下语句。
<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>
以上问题经常同时出现,暴力一点,把文件都改了,就没问题了。至于问题出现的原因,还没有深层的追究,希望各位大神能指点一下。
相关文章推荐
- Google Maps API for Android 指南(一)
- matlab内置函数fitgeotrans与transformPointsForward解析
- DNN Sparse
- Code::Blocks生成的EXE文件执行错误解决:The program can't start because libgcc_s_dw2-1.dll is missing
- 注解(Annotation)
- device eth0 does not seem to be present, delaying initialization
- NYOJ 636 世界末日
- PHP实现页面静态化——局部动态化
- C#-事件
- hadoop 主要配置文件
- onSaveInstanceState和onRestoreInstanceState触发的时机
- Hilbert曲线简介及生成算法
- C++朝花夕拾【更新】
- [国嵌攻略][106][Linux内存管理子系统]
- 图像傅立叶变换的物理意义
- php 获取地址栏参数
- UICollectionView的高级使用和上拉加载下拉刷新
- 蓝桥杯--最大最小公倍数
- vbs 合并 excel 表格
- C++中的string