Maven install Failed to execute goal Org.apache.maven.plugins:maven-war-plugin:2.1.1:war (Default-war) on Project Web_ Nanchang

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.