Avis Sg

Greenhorn
+ Follow
since Aug 29, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Avis Sg

Hi Peter,

Thanks for correcting my typo where i mentioned "resource" instead of "webapp", but what i was trying to explain is how anyone could override the path of web.xml using maven.

Thanks.
12 years ago
Hi,
The default resource directory for all Maven projects is src/main/resources i.e. it will look for the WEB-INF/web.xml inside this location and as your web structure is not like this hence its throwing this error as its not been able to find the web.xml file. In order to override the location please use the plugin in your pom.xml as following assuming the WEB-INF/web.xml is located inside folder WebContent and pom.xml & folder WebContent are on same directory :-
<build>
<finalName>simple-webapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>WebContent</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
This way you can create your WAR. Cheers!!!
12 years ago