Getting started with continuous integration Hudson

Source: Internet
Author: User
Tags time interval tomcat

Unit Test Configuration Management MAVEN project management One of the recommended practices in Tomcat Extreme programming is continuous integration, which is the means of continuously automating the compilation and testing of projects in the development phase to achieve control of code quality.
Continuous integration provides a mechanism to identify problems, track problems, and fix problems in a timely manner, replacing traditional methods of submitting QA departments for testing after all code has been written.
Continuous integration is more dependent on unit testing, the higher the test coverage, the more accurate the unit test, and the more effective the continuous integration. Continuous integration provides benefits mainly in the following areas;

1, continuous automated testing (continuous integration can be triggered by time interval, or other mode of triggering)
2. Track the health status of the project
3. Mandatory unit test cases, acceptance test cases, etc.
4, static code detection, generate test reports

Hudson is a lightweight, easy-to-scale, easy-to-configure, continuous integration platform that maven2 good support and is rich in extensions including FINDBUG,PMD static analysis plug-ins, Emma Unit test coverage plug-ins, JUnit test report plug-ins, and more.

Below we take the Hudson Continuous integration platform as an example, mainly explains how to install Hudson and Hudson Extension plug-in use, and take the MAVEN2 project as an example, set up a new job.

Download the Hudson War package, http://hudson-ci.org/in the Tomcat environment, create a new configuration file Hudson.xml in Conf\catalina\localhost, configured as follows
<?xml version= "1.0" encoding= "UTF-8"?>
<context docbase= "Yourpath/hudson.war" Path= "Hudson" reloadable= "false" >
</Context>
Yourpath is the directory path for Hudson.war.
Launch Tomcat and visit Http://localhost:8080/hudson to access our continuous integration applications. JBoss Environment, copy the war package to the default directory. The following is the installation of the Hudson Access interface.




After the application is set up, we follow the steps.

First, Hudson global configuration information

Hudson configuration, such as JDK installation directory, MAVEN installation directory, SMTP server and user password (for compile failure alert developers)

Go to "System Management" "System settings", set up the MAVEN installation directory, JDK installation directory, others remain the default, if you need advanced configuration, open the prompt message under the question mark, follow the prompts to turn on the appropriate options. The following figure is the configuration information for Maven and JDK.




ii. New task and task configuration

The Hudson task represents a continuous integration project with a task configuration that includes a project versioning branch, an integrated task trigger (when Project integration is triggered)

Go to New task, select the Maven2 project as shown below and enter the task name




After clicking Save, go to the task "Configure" item

The task configuration includes the main SVN project branch configuration, the project integration trigger mechanism configuration, and the compilation target configuration. The configuration is as follows



An integration task is so simple to configure, the current can continue to compile and test, when the discovery test does not pass or the compilation does not pass, the message is sent to the relevant developers (need to configure themselves).

third, add plug-ins and use plug-ins

After configuring a task, we expect Hudson not only to send test reports, compile problems through integration, but also to master the results of static code analysis, such as Findbus or PMD analysis results, or the corresponding report for unit test coverage. Next, we install the Findbus plugin.

Go to "System Management" "Management plug-in", as follows




We found the FindBugs plugin in the "optional plugin", Analysis-core plugin, and download. Go to advanced options. Upload and install the following:



Restart the system, manually trigger the integration, we can see the final integration environment, including the plug-in diagram, and so on, so far, Hudson installation, including some of the features to be researched and used, plug-ins are also colorful.



View Picture Attachments

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.