MAVEN Live---Plug-in dynamic packaging

Source: Internet
Author: User

maven dividing a project's construction into different life cycles (Lifecycle) , this process includes: compiling, testing, packaging, integration testing, validation, deployment. All execution Actions (goal) in Maven need to indicate where they are executing in the process, and then when maven executes, In accordance with the development of the process calls these goal to do various processing.

Here are some of the problems that you will encounter when packing:

Maven using the plugin to dynamically hit War This error occurred in the package:

[ERROR] Failed to execute goal Org.apache.maven.plugins:maven-war-plugin:2.5:war (Default-war) on Project Mavenproj1: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 switch. [ERROR] Re-run Maven using The-x switch to enable full debug logging.  [ERROR] [ERROR] For more information on the errors and possible solutions, please read the following articles:[error] [Help 1] https:// Cwiki.apache.org/confluence/display/maven/mojoexecutionexception

This means that the Web. XML file was not found when building the project , usually the root directory of the Maven Project We built is webapp, Now we change to the WebContent folder, so we need to specify the root directory of the site.

Directory:

WebApp

│- pom.xml

└─src

└─main

├─Resources

└─webapp

│ index.jsp

└─web-inf

Xml


Modify Pom File:

<build > <finalName>gx</finalName> <plugins> <plugin> <groupid>org.apach E.maven.plugins</groupid> <artifactId>maven-war-plugin</artifactId> <version> ;2.5</version> <configuration> <!--Specify the location of the Web. xml file, which is a way to-->                ; <webXml>WebContent\WEB-INF\web.xml</webXml><!--Specify directory location, this is another way to put all the XML files in this directory into the JAR package--< !--<webResources>            <resource>          &NBSP ;     <directory>webContent</directory>            </resource>     </webResources>--> </configuration> </plugin> </plugins>< ;/build> 

            These things are essential to our maven project, and this is mainly in the maven plugin mechanism,maven The plug-in mechanism is dependent on the Maven lifecycle.

MAVEN Live---Plug-in dynamic packaging

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.