Technical work, should be praised and then see, form a habitCopy the code

Jenkins uses the tutorial related series catalog


Jenkins Maven support (Maven Integration plugin installation and use)

Step-by-step instructions

Create a new item

2. Build a Maven project with unique task names

Discard old builds: Set the build history preservation policy

Project name: is set in the create build task step and can be changed here as well.

Description: A description of the build task.

Discarding old builds: Server resources are limited and sometimes saving too many historical builds can slow Jenkins down and overwhelm the server’s hard drive. Of course, the number of days for which the build is held and the maximum number of days for which the build is held can be customized. You need to set a reasonable value based on the actual situation.

The Rotation of the build history to the log cycle Means to keep build records based on the number of days you fill in. The maximum number of build records to keep means to keep as many releases as there are build records For example, if we publish several war packages, we will save a few

4. The SVN is used here. It is easy to understand that the URL and account password of the SVN are provided

5, this demo is not used, the default is ok

A build trigger, as its name suggests, is a trigger for a build task.

Trigger remote builds (for example, using scripts): This option provides an interface that can be used to trigger builds at the code level. I’m not going to do it here, but I might need it later.

Build after other projects are built: This option means “Build after other projects are built”. This option is not covered here, but may be used later.

Periodically: Build periodically. It’s a good idea to build every once in a while. The calendar format is similar to the Linux Crontab format. The Settings in the figure below represent a build every 30 minutes.

Poll SCM: This option is used in conjunction with the above option. Jenkins doesn’t know when the code repository changes. This option needs to be configured periodically to check for changes to the code repository.

 

6, this demo is not used, the default is ok

7. Which POM file to run when building the source code

And the script commands executed when compiling the Maven project

Add compile -dmaven.pile.fork =true to indicate multi-threaded compile;

 

8. Apply and save

9. Run 1. The construction process can be seen in 2

Construction Result Description

Build status

Successful blue: The build is complete and is considered stable.

Unstable Yellow: The build is complete but is considered Unstable.

Failed Red: The build Failed.

Disable Grey: Build is disabled

Build stability

Construction stability is expressed by weather: sunny, sunny to cloudy, cloudy, light rain, thunder shower. Better weather means a more stable build and vice versa.