I am trying to deploy a create a WAR file for portlet project. I ran the command mvn package but its throwing an exception. I Googled on the exception and i found it to be common one. Here's the exception:
I checked in Google for the exception "[INFO] Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)" and found that it is already logged in JIRA.
In order to update the plugin you need to reference it in your pom.xml file that is creating the WAR. The plugin will be downloaded and used automatically, see the documentation on the maven-war plugin on their website for details on how to declare this plugin in your POM.
I created a "Dynamic Web Project" in Eclipse that comes with a web.xml. It is there in the WEB-INF folder. Then i created the pom file using m2eclipse plugin. Then ran mvn package command. That is the process i am following.
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 :-
<!-- this is relative to the pom.xml directory -->
This way you can create your WAR. Cheers!!!