eclipse中maven因没有web.xml报错
来源:互联网 发布:淘宝店铺怎么设置淘客 编辑:程序博客网 时间:2024/05/22 02:11
在使用eclipse创建maven项目的时候,有时候会出现这个问题:
web.xml is missing and 'failOnMissingWebXml' is set to true
我遇到这个问题是因为现在一般的web项目已经不需要web.xml文件了,于是我把它删掉了(eclipse自动创建了这个问题,但是我不需要所以删掉了),然后就提示了这个问题。
这个问题的原因是maven看到我们项目的类型是war
- <packaging>war</packaging>
所以他说怎么可以没有web.xml了呢?
但是web.xml本来就不是必须的,我们总不能很开心的接受一个接近于空白的文件非要跻身于我们的项目中啊。那怎办呢?
一般有两种方法:
第一种当然是创建一个web.xml了。
但是更推荐第二种,因为第一种会在项目里有一个无用文件。
第二种是告诉maven,我真的不需要web.xml了:
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- </configuration>
- </plugin>
- </plugins>
- </build>
这样就可以了,其中的version不是必需的。
阅读全文
0 0
- eclipse中maven因没有web.xml报错
- eclipse中maven web项目maven bulid报错
- eclipse中maven配置文件pom.xml解析报错
- Eclipse Maven "Create a simple project" 没有web.xml文件
- 【maven】web项目不需要web.xml,maven打包报错
- eclipse创建maven web项目时,pom.xml文件报错
- eclipse新建maven的web项目时,pom.xml的war报错解决方法
- eclipse maven项目pom报错web.xml is missing and <failOnMissingWebXml> is set to true
- Maven中pom.xml报错:web.xml is missing and <failOnMissingWebXml> is set to true
- web.xml中<web-app>报错
- maven 中 pom.xml 文件报错
- eclipse中Maven项目pom.xml报错:com.thoughtworks.xstream.io.HierarchicalStreamDriver
- Eclipse中使用Maven创建Web项目index.jsp报错
- eclipse中创建maven pom.xml报错Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugin
- Eclipse中Maven新建web项目报错Could not calculate build plan:Plugin org.apache.maven.plugins...
- eclipse下新建Maven项目index.xml文件报错
- eclipse安装maven时,pom.xml提示报错
- 在eclipse平台上,通过maven构建web项目时,pom.xml报错web.xml is missing and <failOnMissingWebXml> is set to true
- HDUOJ 1004 Let the Balloon Rise(map容器)
- 【hautoj 1283】: YK的书架 【打表找规律】
- JavaWeb项目:整合(Lucene+Redis+SSM)实现搜索功能
- Android生成带图片的二维码
- 待起飞的の集训8.5
- eclipse中maven因没有web.xml报错
- [bzoj4597/Shoi2016]随机序列
- POJ 1436 Horizontally Visible Segments(线段树区间更新)
- 《leetCode》:palindrome Number
- Java变量的作用范围
- poj 1845 所有因子和
- “百度之星”资格赛 1004 度度熊与邪恶大魔王
- 51Nod 1264 线段相交
- POJ