When Maven was packaged into a war, error: Failed to execute goal Org.apache.maven.plugins:maven-war-plugin:2.1.1:war (Default-war) on project Web_nanchang:error assembling War:webxml attribute is required
Reason: Could not find web. XML, but the project has this file, in the webcontent/web-inf/folder, is not recognized
Workaround:
Needs to be in the Pom.xml file, plus the Maven-war-plugin plugin configuration
Add in the <build> node:
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> < artifactid>maven-war-plugin</artifactid> <version>2.4</version> <configuration > <webResources> <resource> <directory>WebContent</directory> < /resource> </webResources> </configuration> </plugin> </plugins >
If you do not already have the Web. xml file in your project, you need to add the following configuration:
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> < artifactid>maven-war-plugin</artifactid> <version>2.4</version> <configuration > <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </ Plugin> </plugins>
Maven install Failed to execute goal Org.apache.maven.plugins:maven-war-plugin:2.1.1:war (Default-war) on Project Web_ Nanchang