[Java][Maven]Maven部署Web项目报错webxml attribute is required
2014-04-11 11:25
429 查看
mvn install一个web项目时,报错如下:Error assembling WAR:webxml attribute is required
原因:
maven的web项目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml就抛出以上的异常。
解决办法:需要在pom.xml中增加<webResources>配置,如下:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project com.alpha.webapp: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
原因:
maven的web项目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml就抛出以上的异常。
解决办法:需要在pom.xml中增加<webResources>配置,如下:
<build> <finalName>simple-webapp</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <webXml>WebContent\WEB-INF\web.xml</webXml> </configuration> </plugin> </plugins> </build>
相关文章推荐
- [Java][Maven]Maven部署Web项目报错webxml attribute is required
- [Java][Maven]Maven部署Web项目报错webxml attribute is required
- [Java][Maven]Maven部署Web项目报错webxml attribute is required
- Maven部署Web项目报错webxml attribute is required
- 【Maven】Maven部署Web项目报错webxml attribute is required
- 【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
- Maven打包web项目报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if
- Maven打包web项目报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if
- 构建maven项目时候报错 web.xml is missing and <failOnMissingWebXml> is set to true
- 解决 "检出Maven项目web.xml is missing"错误 和 “Dynamic Web Module 3.0 requires Java 1.6 or newer.”错误
- Maven报错:Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml
- 项目重新部署后报The attribute required is undefined for the annotation type XmlElementRef
- maven-install报错:webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update
- MAVEN: Error assembling WAR: webxml attribute is required
- eclipse部署maven web项目到tomcat服务器时,没有将lib、web.xml复制过去的解决办法
- maven项目出现web.xml is missing and <failOnMissingWebXml> is set to true错误的解决办法
- 部署Maven项目到tomcat报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi
- 解决使用maven的java web项目导入后出现的有关问题 -cannot be read or is not a valid ZIP file
- 创建Maven web项目时 出现 web.xml is missing and <failOnMissingWebXml> is set to true错误 pox.xml编译错误
- Java EE eclipse安装之后新建Dynamic Web Project项目报错 Project facet Java version 1.8 is not supported.