Continuous integration of Jenkins and Maven build

Source: Internet
Author: User

Continuous integration of Jenkins and Maven build

It's really a benefit for O & M. You don't have to worry about Linux commands.

Required tools: war packages for Linux or windows, Jenkins, tomcat7, Jdk, maven, and project deployment

1. First download the latest Jenkins war package http://jenkins-ci.org/

2. Place jenkins. war under tomcat's webApps and start tomcat as follows:

Click "System Management-system settings", as shown in:

After the configuration is complete, click Apply and save.

3. After the system is configured, start to build the project. The following describes how to build a maven project, as shown in:

Configure the constructed project

Note that if you want to configure the build operation, you need to install a deploy plug-in for Jenkins. After the installation is complete, restart the Jenkins service.

The configuration is basically completed here, but the Build step 'deploy war/ear to a iner 'marked build as failure or unable to delete will appear during the continuous Build process .... Or memory overflow and other exceptions, you also need to configure tomcat.

First, add the following content to the catalina. bat file of tomcat for memory overflow.

Set JAVA_OPTS = % JAVA_OPTS % LOGGING_MANAGER %
Set JAVA_OPTS =-Xms1024M-Xmx1024M-XX: PermSize = 256 M-XX: MaxNewSize = 256 M-XX: MaxPermSize = 256 M

In case of an unable to delete tomcat/webApps/XXX. war exception, add:

<Context antiJARLocking = "true" antiResourceLocking = "true">
For Build step 'deploy war/ear to a iner 'marked build as failure (extension file error)

Through the above modification and optimization, a warning is reported during continuous building to prevent memory leakage, which has been forcibly deregistered. After testing, the program access is not affected. (Because the project is being redeploying at runtime)
To prevent a memory leak, the JDBC Driver has been forcibly unregister
Ed.
To be safe, I added

<Role rolename = "manager-gui"/>
<Role rolename = "manager-script"/>
<Role rolename = "manager-jmx"/>
<Role rolename = "manager-status"/>
<User username = "tomcat" password = "tomcat" roles = "manager-script, manager-gui, manager-jmx, manager-status"/>
</Tomcat-users>
If you have any questions, please contact us. Thank you!

Maven official guide _ Chinese full version clear PDF

Maven 3.1.0 release, Project Build Tool

Install Maven in Linux

Maven3.0 configuration and simple use

Set up sun-jdk and Maven2 in Ubuntu

Get started with Maven

Distributed building and deployment of Jenkins-nodes

Jenkins details: click here
Jenkins: click here

This article permanently updates the link address:

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.