问题:maven构建工程时报错webxml attribute is required
错误信息:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
说明:
In general, for a Java-based Maven project, non-source files should go in the src/main/resources
sub-directory of the project. The contents of that resources
directory are copied to the output directory (by default, target/classes
) during the process-resources phase of the build.
For Maven WAR projects, it is slightly more complicated: there is also the src/main/webapp
directory, wherein Maven expects to find WEB-INF/web.xml
. To build your WAR file, that file must exist; otherwise, you'll see an error message like that:
As the WEB-INF
directory must exist under src/main/webapp
, I'd recommend avoiding defining it again in src/main/resources
. Although this is perfectly valid and the contents of the two directories will be merged, it can get confusing if a file is defined in both. The contents of src/main/resources
will take precedence as they are copied over the top of the contents from src/main/webapp
.
解决方案:
在WEB-INF/web.xml中增加一个web.xml用于占位
分享到:
相关推荐
webxml详解webxml详解webxml详解webxml详解 webxml详解
servlet3 without webxml servlet3 without webxml
详细介绍VC#的WebXML编程
Web应用就是包括了一系列Servlet 、JSP 、 HTML等相关文件的集合,它需要成功...服务器中才能运行和被访问。 根据Servlet的规范,Web应用中的所有文件必须按照特定的目录结构进行组织,才能顺利地部署到不同服务器中
一个使用webservice的例子 java编写的 调用http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx的webservice服务
在子线程完成数据的获取,因为现在主线程不支持网络连接了,学习这个的时候就写了这个,下一步学习天气预报,总之是网络获取数据一类的,大家相互学习。
webXML样板1
springmvc-without-webxml springmvc-without-webxmlspringmvc-without-webxml
codeproject上的网络编程,webxml
webxml文件详解[借鉴].pdf
基于ExtJS的WebXML编辑器设计与实现.pdf
详解Tomcat中用web.xml控制Web应用
对于web.xml的配置,实在不好记忆,如果经验还不足的话,收藏一个已配置好的web.xml备用
source code let u learn how working with xml classes of c++.
web.xmlweb.xmlweb.xml
web xml 详解,web xml 详解
WeatherWebService-soapui-project.xml
利用XML来格式化写入EXCEL并下载,很实用的代码!初学者研究一翻,我保证您绝对获益不浅!
从http://www.webxml.com.cn获取城市天气的XML数据,根据不同请求方式返回的两种类型的数据(流和String),采用pull解析 博客地址:https://blog.csdn.net/qq569699973
很好,很强大.所有关于web.xml的配置都在这个文档中。