Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Automatic Construction method of configuring Git+Maven with Jenkins under centos

Shulou Source: shulou.com Published: 2022-06-02 07:53:48 10月02日 Update

This article mainly explains "the automatic construction method of configuring Git+Maven using Jenkins under centos". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian slowly and deeply to study and learn "the automatic construction method of configuring Git+Maven using Jenkins under centos" together!

Using Jenkins to configure automated builds of Git+Maven under centos

>Jenkins is an open source continuous integration tool, Jenkins application to build continuous integration environment, can be automatically built, automatically compiled and deployed, very convenient.

> In the case of fewer servers, Jenkins 'advantages are not obvious, but with the development of the project, the number of servers increases, Jenkins' advantages will be highlighted, which can improve efficiency and reduce a lot of manual operations.

> Now many companies Java project development is using Git or SVN management code, Maven management of multiple modules and project dependencies, so today try to learn how to use Jenkins to build Github and Maven automatic build and deployment.

Deploying Jenkins

Official website http://jenkins-ci.org/. The current version is 1.629.

Jenkins installation is very simple, after downloading is a jenkins.war package, can be directly deployed in Tomcat or other containers. In addition, the official website also has related installation of.deb, etc., which is more cumbersome. You can choose which way to deploy.

Install related plugins

Copy the war file to Tomcat's webapps directory,

After startup, go to http://SERVER_PATH:8080/jenkins/and you can see that Jenkins is already running:

To configure Git repository, we need to use Git plug-ins. At the same time, we also need to install maven plug-ins. Other plug-ins can be installed selectively according to the situation.

global configuration

Create tasks, configure project information

common problems

git ERROR: Unable to find remote helper for 'https'

The reason is: /usr/local/git/libexec/git-core/path is not in PATH environment variable

Project does not start/invalid after executing shell command

The reason is: jenkins will kill all spawned processes by default after build

Solution:

For each item: add BUILD_ID=DONTKILLME to the execute shell input box to prevent jenkins from killing the tomcat process that started.

Permanent solution: disable jenkins from killing spawned processes when jenkins is started

Start with java -jar, -Dhudson.util.ProcessTree.disable=true -jar jenkins.war

Start Tomcat, Linux system modify catalina.sh, after the description of environment variables, add this sentence JAVA_OPTS="$JAVA_OPTS -Dhudson.util.ProcessTree.disable=true" before the script; restart Tomcat after modifying Tomcat configuration file

Thank you for reading, the above is the content of "using Jenkins to configure Git+Maven automated construction method under centos". After studying this article, I believe that everyone has a deeper understanding of the problem of using Jenkins to configure Git+Maven automated construction method under centos. The specific use situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Configuration automation methods plug-ins projects learning situations environments processes advantages contents reasons variables that is files scenarios servers problems services management Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Xiaomi Microsoft NVidia Apple