maven-using Hudson for continuous integration and system configuration

Source: Internet
Author: User
Tags checkstyle

maven-monitoring tasks, user management, working directory

maven-Creating Hudson Tasks


12.1 The role, process, and benefits of continuous integration

 simply put, continuous integration is a fast and high frequency automatic component project for all source code, and provides the project members with rich feedback information.
-Fast: integration is as fast as possible, and developers don't want their code to be submitted for half a day before they get feedback.
-High frequency: The higher the frequency, the better, such as every one hours is a good choice, so that the problem can be reflected this morning.
--Automatic: Continuous integration should be triggered and executed automatically, and there should be no manual involvement.
--Components: including compilation, testing, review, packaging, deployment, and other work.
--All code: The latest source code that all team members submit to the CODEBASE.
--Feedback: Continuous integration should tell team members the latest integration status through a variety of shortcuts, and when integration fails, feedback includesas much as possible to reflect the specific details of failure.
A complete integration often consists of the following 6 steps:
1) Continuous compilation: All formal source code should be submitted to the source control system (such as subversion), continuous integration Server at a certain frequencyCheck the source control system, if there is a new code, trigger an integration, the old compiled bytecode should be cleared all, and then the server compiledall the latest source code.

2) Continuous database integration: Continuous integration should also include database integration, and every time new SQL scripts are discovered, the data of the integrated environment should be cleaned upLibrary, rebuild the table structure, and fill in the pre-built data. This makes it possible to find script errors at any time, and in addition, the test environment based on these scriptscan further identify other related issues.

3) Continuous testing: With a framework such as JUNIT, automated testing is possible. It's not easy to write good unit tests .must be automated, repeatable, environment-independent, and self-checking. In addition to unit tests, some projects also containSome integration tests that depend on the external environment. All of these tests should be run at each time of integration, and when a problem occurs, a specific report is generatedThe report.

4) Continuous review: Tools such as Checkstyle and PMD can help us find bad taste in the code (poor smell), and continuous integration canuse these tools to generate various reports, Checkstyle reports, and PMD reports. These reports can be generated at a lower frequency, such as generating a dailytimes, you can give the developer feedback warning when the review finds a problem.

5) Continuous deployment: Some errors can only be discovered after deployment, they are often specific containers or environment-related, automated deployment can helphelp us find such problems as quickly as possible.

6) Continuous feedback: The last step of continuous integration is feedback, usually an email. Send the message to the right person at an important time. If the developer has been receiving continuous integration reports unrelated to himself, he slowly ignores the reports. The basic rule is: to integrate the LostThe report is sent to this integration-related code submitter, and the project manager should receive all the failure reports. continuous integration requires the introduction of additional hardware settings, especially for continuous integration servers , where the higher the performance, the faster the integration, and the feedbackThe faster it gets. Continuous integration also requires developers to use a variety of tools, such as source control tools, automated build tools, automated test tools,continuous integration of software. This has undoubtedly increased the burden on developers, but learning and adapting to these tools and processes is well worth theThere are many benefits to continuous integration:
--Early exposure issues
--Reduce repetitive operations
--Simplified project release
--Build Team confidence


12.2 Hudson Introduction
There are many excellent tools for continuous integration, such as old-style open source tools CruiseControl, commercial bamboo and teamcity. Hudson is currently the mostthe popular open source continuous integration tool. The project was previously hosted in the Java.net community and is now migrating to http://hudson-ci.org/. HudsonThere are mainly Kohsuke Kawaguchi developed and maintained.


12.3 Installing Hudson
Installing the Hudson is very simple. It should be noted that the Hudson must be running on JRE 1.5 or later. Can be inhttp:hudson-ci.org/Download the latest version of the installation package.


The simplest way to start Hudson is to run Hudson.war directly on the command line:

$ java-jar Hudson.war


Hudson boot log direct output command line, after the start of the completion of the user can open the browser input address

http://localhost:8080/access to the Hudson interface:



Figure 3

to stop Hudson, you can press CTRL + C at the command line
remark:

(1) By default Hudson will run on port 8080, which may conflict with the user's existing web app. At this point, the user can use

 -- The Httpport option specifies the running port of the Hudson

$ Java-jar Hudson.war--httpport=8082


(2) since he is a war file, Hudson can naturally be deployed to various web containers, such as Tomcat. (the first time it will prompt you to install some plug-ins to better play Hudson, recommend the core and recommended parts installed, if not installed, at the bottom there is a Finish button, click to enter the Figure 3)


12.4 Installing Subversion
I believe this tool has been installed, we will not repeat it here. If not, from a Baidu a bit on the line.


Basic system settings for 12.5 Hudson
before creating the Hudson Continuous Integration task, users need to do some basic configuration of the Hudson system, including JDK installation location and MAVEN installation, etc.must be configured correctly first. Hudson will use these configured JDK and MAVEN for continuous integration tasks. If you want to useant or Shell to continue the integration project, the Ant cargo shell installation location should also be pre-set correctly.



In the left menu bar there is a system management, then click on the right to find "system settings" to enter the system settings page



1: First configure the JDK and Maven here, and find the locally installed directory (remove the automatic installation tick). If you haven't downloaded it, you can also download it here (check the auto-install button)

The 2:jdk directory is the value of the Java_home variable you configure in the environment variable, and Maoven is the maven_opts variable in your environment variable. values.

3: Finally click the Save button at the bottom of the page to save the system settings.

maven-using Hudson for continuous integration and system configuration

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.