maven-Creating Hudson Tasks

Source: Internet
Author: User

maven-using Hudson for continuous integration and system configuration

maven-monitoring tasks, user management, working directory

1 Creating a Hudson Task

to create a Hudson task to continuously integrate the MAVEN project, first click on the new task on the left side of the page, then select the task on the right side of the page the name and type of the.


There are three types here, which are free-style and multi-configuration, which requires a bit more configuration with the transfer, while the former uses Hudson comes with Maven, and gets enough information from the project's pom to avoid some configuration. Unless you are very familiar with Hudson, you will still choose the free style. As for the surveillance, I didn't use ...



1.1 Basic configuration of Hudson tasks
1: First is the name and description of the project. Concise and meaningful names and descriptions are important when Hudson tasks are more numerous.
2: Next is an important option for Discard old Builds. This option configures how to discard the old artifacts. Hudson each time the artifact task is executed, you can save the corresponding source code, build the output, build the report and other files. Obviously, if each artifact-related file is saved, it willwill gradually consume light disk space. To do this, Hudson provides two ways for users to choose which component tasks to retain for the relevant files, respectively:
days to keep builds: if its value is non-empty n, only the artifact file within N day is reserved.
Max # of builds to keep: If # is not empty, only the relevant files of the most recent widget are kept.

The configuration represents a maximum of 10 most recent artifacts.



1.2 Hudson Task source repository configuration
Next, you need to configure the project's source control system. On the project configuration page, in the Source Code Management Section, select the Subversion radio button, and enter the warehouse address of the project in the repository URL text, in general, the other options for that section are reserved by default.

It is important to note that if authentication is required to access the Subversion repository, Hudson will automatically detect and prompt the user to enter the authentication information




After you click Enter Credential, Hudson will pop up a page to let the user select the authentication method and enter the authentication information. After entering the correct information,Hudson will be able to read the warehouse source code.




build trigger configuration for 1.3 Hudson tasks

The Build triggers configuration is a way to trigger artifacts, respectively:
--build After other jobs is built: component of this project after the completion of other project artifacts
--build periodically: Periodic component of the project
--poll SCM: Periodically polling the source repository, found that there are updates when the component of this project.
In the absence of special advanced needs, the first method is generally not chosen; the second method creates some meaningless artifacts, if the source that the component is based on several timesThe code does not have any difference, the output of the component is often not changed, the third way is not the problem, it can avoid unnecessary component savingsResources for the continuous integration server. This cycle of polling the source code warehouse is actually the most common way to build triggers. since it is polling, you need to configure the frequency of polling, Hudson uses the UNIX Task Scheduler tool, which uses 5 fields to represent different timesUnit:
Day of the week

minute: Minutes in an hour (0-59)
hours: Hour of the day (0-23)
Day: January date (1-31)
Month: Month (1-12)
Day of the week: Day of Week (1-12)
each of these fields can use some special characters in addition to the values in its range:
*: The asterisk indicates all values in the matching range.
m-n: A hyphen indicates that all values in the range of m-n are matched, such as: 1-5.
a,b...,z: Comma means matching multiple values, such as 0,15,0
*/x or m-n/x: a range with a slash indicates a value that is divisible by X in the match range, such as 1-10/3 equivalent to 3,6,9

Example:
* * * *: per minute.
5****: The fifth minute of every hour.
*/10****: every 10 minutes.
45 10**1-5: Every Monday to Friday 10:45.
0,30*13*5: Every half hour of number 13th per month.

For a healthy project, it is common practice to poll the code base every 10 minutes


Note: You can use # to add comments, and blank lines are ignored.


1.4 Hudson Task build configuration
Next, you'll tell Hudson to use the MAVEN command artifact project. Click the Add build step lower triangle button in the Build section and select:


Select an installed MAVEN version and enter the MAVEN command like clean deploy.


It is important to note that if the daily continuous integration task succeeds, a snapshot version of the project artifacts will be generated. If you maintain a maven, thatThe continuous integration task should automatically deploy the artifacts to the use of other projects. This is why you use clean deploy. at this point, the Hudson task configuration is basically complete, click the Save button to save, and then:

maven-Creating Hudson Tasks

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.