While executing mvn install
, I'm getting following error:
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
My web application structure tree is like that:
my-app
|-- pom.xml
|-- src
|-- ...
|-- WebContent
|-- ...
|-- META-INF
|-- WEB-INF
|-- classes
|-- ...
|-- lib
|-- **web.xml**
My POM file looks like that:
<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 ?
Regards
I strongly recommend to use Maven's standard layout:
src/main/java
(and remove the sourceDirectory
element)src/main/webapp
classes
and lib
directories under WEB-INF
Sure, you can customize the layout but this is IMO more troubles and useless efforts than benefits. Just follow the conventions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With