构建WAR软件包时出现Maven错误(缺少web.xml. [英] Maven error while building WAR package (web.xml missing..?)
本文介绍了构建WAR软件包时出现Maven错误(缺少web.xml.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在执行mvn install
时,出现以下错误:
While executing mvn install
, I'm getting following error:
组装WAR时出错:webxml属性 是必需的(或预先存在的 WEB-INF/web.xml(如果在更新中执行) 模式)
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
我的Web应用程序结构树是这样的:
My web application structure tree is like that:
my-app
|-- pom.xml
|-- src
|-- ...
|-- WebContent
|-- ...
|-- META-INF
|-- WEB-INF
|-- classes
|-- ...
|-- lib
|-- **web.xml**
我的POM文件如下:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>masters.traffic</groupId>
<artifactId>traffic_web</artifactId>
<packaging>war</packaging>
<name>traffic_web</name>
<version>0.1.0</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
如何正确解决该问题?
How to properly fix that issue ?
致谢
推荐答案
查看全文