Maven Error Assembling War Webxml Attribute Is Required
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project Us Learn more about Stack Overflow the company Business Learn more about hiring
Error Assembling War Webxml Attribute Is Required Spring Boot
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Maven Error assembling WAR: webxml attribute
Maven Web.xml Location
is required when building the SpringMVC project with pure Java Based Configuration and no xml's up vote 5 down vote favorite 3 I am developing a Spring MVC project with pure Java based configuration. I am getting the error below when I do a Maven clean install. Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project SpringMVC-ShoppingCart: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml maven web.xml example if executing in update mode) -> [Help 1] The error says that web.xml is missing, but I did not have one since I used pure Java based configuration. How to make sure that the project builds and creates war file without web.xml? java maven spring-mvc web-applications maven-assembly-plugin share|improve this question edited Oct 28 '15 at 12:02 Tunaki 57.5k1886117 asked Oct 28 '15 at 11:59 Omkar Puttagunta 1,2421716 add a comment| 1 Answer 1 active oldest votes up vote 9 down vote accepted You need to configure the maven-war-plugin to ignore the missing web.xml file with the failOnMissingWebXml attribute set to false. By default, this plugin expects a web.xml, which explains the error you are getting. Sample configuration:
here for a quick overview of the site Help Center Detailed answers to any questions
Maven-war-plugin Version
you might have Meta Discuss the workings and policies of this
Maven-war-plugin Configuration
site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers warning: selected war files include a web-inf/web.xml which will be ignored or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a http://stackoverflow.com/questions/33390460/maven-error-assembling-war-webxml-attribute-is-required-when-building-the-sprin community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up mvn package error when trying mvn package up vote 0 down vote favorite 1 I have checked out a project from svn. I am trying to build the project using maven. It builds http://stackoverflow.com/questions/27612961/mvn-package-error-when-trying-mvn-package fine with mvn compile. when i try the command mvn package, i get the following error. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.737 s [INFO] Finished at: 2014-12-22T19:30:54-06:00 [INFO] Final Memory: 12M/155M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project usermanager: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE I find that this is because, the web.xml is not provided to the pom.xml. I have tried all the ways given in the answers in stack over flow. But none does seem to work Here is my pom.xml
this release is ease http://www.javaroots.com/2014/01/webxml-attribute-is-required-error-in.html of development . Now you don't have to write configurations related things in web.xml , you can write all these things by using annotations https://www.eclipse.org/forums/index.php/t/199643/ . So , from servlet 3.0 , web.xml is optional (however , if web.xml is present , it will be given preference over error assembling annotations ) . If you are using maven for packaging your war , you might get following error if you don't have web.xml in your application . Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project webSocketExample: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml error assembling war if executing in update mode) -> [Help 1] You can resolve this error by adding following lines in your pom.xml
Things LocationTech Long-Term Support PolarSys Science OpenMDM More Community Marketplace Events Planet Eclipse Newsletter Videos Participate Report a Bug Forums Mailing Lists Wiki IRC How to Contribute Working Groups Automotive Internet of Things LocationTech Long-Term Support PolarSys Science OpenMDM Toggle navigation Home Projects Forums Eclipse Community Forums Forum Search: Search Help Register Login Home Home» Eclipse Projects» Eclipse Platform» Maven Error assembling WAR Show: Today's Messages :: Show Polls :: Message Navigator Maven Error assembling WAR [message #637046] Wed, 03 November 2010 22:49 john Messages: 4Registered: November 2010 Junior Member i got the follwoign error when i tried i run the following command line:- >>mvn clean install [INFO] Error assembling WAR: webxml attribute is required (or pre-existing WEB-I NF/web.xml if executing in update mode) so i have maually created the web.xml file on the required directory, and i rerun the command line again and every thig went succsfully. So did i do the right thing? and how i can let the maven it self to create the web.xml file? Report message to a moderator Re: Maven Error assembling WAR [message #641252 is a reply to message #637046] Wed, 24 November 2010 16:18 szymonMessages: 1Registered: November 2010 Junior Member from here This problem is solved by this way -- just add to your pom.xml following plugin with the WebXml attribute (here u should set path to your web.xml): < build > < plugins > < plugin > < groupId >org.apache.maven.plugins< /groupId > < artifactId >maven-war-plugin< /artifactId < configuration > < webXml >WebContent/WEB-INF/web.xml< /webXml > < /configuration > < /plugin > < /plugins > < finalName >u-app< /finalName > < /build > Report message to a moderator Previous Topic:View stack not correctly painted for a newly opened perspective Next Topic:visible tabs Goto Forum: - NewcomersNewcomers- Language IDEsAJDTAndmoreC / C++ IDE (CDT)CheJava De