Sunday, October 26, 2014

Fixed Error assembling WAR: webxml attribute is required

Removed
Using Maven, I was building my application, but I get this error.


[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project myProject: 
Error assembling WAR: webxml attribute is required
 (or pre-existing WEB-INF/web.xml if executing in update mode)

In fact, with Servlet 3, I am no more supposed to specify my Web.xml and I can use annotations like @WebServlet, @WebFilter.

So two solutions are possible :


Solution 1 : Add web.xml path
:



<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-war-plugin</artifactId>
 <configuration>
   
          <webXml>src\main\webapps\WEB-INF\web.xml</webXml>
    
 </configuration>
</plugin>

Solution 2 : Ignore the Web.xml as you don't have it



<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-war-plugin</artifactId>
 <configuration>  
  <failOnMissingWebXml>false</failOnMissingWebXml>
 </configuration>
</plugin>



No comments :

Post a Comment

Articles les plus consultés