Maven打包web项目报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if
2017-02-15 14:43
543 查看
maven install web项目时报错:
原因分析:
maven的web项目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml就抛出以上的异常。
解决办法:
1、将webroot修改为webapp
2、在pom.xml中指定web.xml,如下:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project spring2: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
原因分析:
maven的web项目默认的webroot是在src\main\webapp。如果在此目录下找不到web.xml就抛出以上的异常。
解决办法:
1、将webroot修改为webapp
2、在pom.xml中指定web.xml,如下:
<build> <finalName>web-app-name</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.2</version> <configuration> <webXml>WebContent\WEB-INF\web.xml</webXml> </configuration> </plugin> </plugins> </build>
相关文章推荐
- Maven打包web项目报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if
- 【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
- maven-install报错:webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update
- Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
- webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
- Maven报错:Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml
- Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
- IDEA Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executin
- Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
- Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
- Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml
- [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
- [Java][Maven]Maven部署Web项目报错webxml attribute is required
- 【Maven】Maven部署Web项目报错webxml attribute is required
- MAVEN: Error assembling WAR: webxml attribute is required
- maven项目报错--Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Qu
- 解决使用maven的java web项目导入后出现的有关问题, -cannot be read or is not a valid zip file