Maven implements Web application integration test yourself proactively-deploy your own initiative (WebTest Maven Plugin)

Source: Internet
Author: User
Tags jboss

Previous: Maven implementation of Web application integration Test Self-initiative-Test Self-initiative (WebTest Maven Plugin)

Before describing how to use the WebTest plug-in to implement the Web integration test in Maven, here's a legacy issue, which is that when you run Maven's intergation test, the Web application is already deployed in the container in the in service state. So is the deployment of Web applications enough to be proactive? In our company's system, because uses the WebLogic cluster, has written the footstep to realize the deployment, has spent a lot of manpower and resources, actually the Java Web application already had the gospel, It is a plug-in artifact that proactively installs containers and deploys applications: Cargo-maven2-plugin, which is compatible with all current mainstream servers such as JBoss, Tomcat, GlassFish, Jetty, and more.

It is very easy to configure, add Cargo-maven2-plugin in Build, in order to realize the integration test self-initiated, declare the integration test phase before calling Cargo:start launch container and deploy the application, integrated test end call Cargo: Stop to close the container. The default start container ends at the end of the Maven lifetime, and sometimes, for debugging, it is possible to invoke Cargo:run to launch the container and deploy the application, and then end the container execution with CTRL + C when needed.

In order to implement the container start-up and deployment of their own initiative, but also to provide some configuration parameters to the plug-in, the following is a demonstration sample, cargo also has a lot of other functions, detailed can refer to: Cargo own initiative to deploy the official site

                     <plugin> <groupid>org.codehaus.cargo</gr Oupid> <artifactId>cargo-maven2-plugin</artifactId> <versio                                    N>${project.cargopluginversion}</version> <configuration> <!--definition Container--<container> <!--Co Ntainer Type Jetty/tomcat/weblogic/jboss etc--and <containerid>${project.cargo.contain                                 er}</containerid> <!--Specify the container download path, save the path, unzip the path, put in the target folder can be clean when you voluntarily clear-- <zipUrlInstaller> <url>${project.cargo.contain Er.url}</url> <downloaddir>${project.build.directory}/${project.cargo.cont Ainer}/downloads</dowNloaddir> <extractdir>${project.build.directory}/${project.cargo.container}/e Xtracts</extractdir> </zipUrlInstaller> <!-                                         -Cargo Log Storage-<log>${project.build.directory}/logs/cargo.log</log> <!--container Log storage--<output>${project                            .build.directory}/logs/container.out</output> </container> <!--join container related configuration information-<configuration> < !--set Deploy home--

Maven implements Web application integration test yourself proactively-deploy your own initiative (WebTest Maven Plugin)

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.