- DevOps for Salesforce
- Priyanka Dive Nagraj Gornalli
- 232字
- 2021-07-16 17:38:55
Configuring Maven in the Jenkins server
Go to Manage Jenkins | Global Tool Configuration.
We have already installed Maven on our machine. So enter a name for the Maven installation and the M2_HOME path as follows:

Let's configure our Jenkins job to build our sample project:
- Click on create new jobs:

- Create a Jenkins job with the Maven plugin. Provide the job name devops-ci-cd (you can choose another project name, if you want):

- In the Source Code Management section, provide the Git URL of your project. Provide credentials to clone the repository in Jenkins:

- Choose GitHub hook trigger for GitScm polling in Build Triggers. If Jenkins receives a PUSH GitHub webhook from the preceding repository, it will trigger this job:

- Provide a path to root pom.xml. It will be a relative path to the module root. In Build, add Root POM as pom.xml and Goals and options as package:

- Save your work and click on Build now.
This will create my-app-1.0-SNAPSHOT.jar in the /var/lib/Jenkins/workspace/target folder. You can check the console logs while the project build is in progress.
Once the JAR is successfully built, you can see the console logs as shown in the following screenshot:

We have completed a continuous integration job successfully. Now, we need to add the Jenkins webhook URL in the GitHub settings to trigger a Jenkins build whenever someone pushes code to our GitHub project.
推薦閱讀
- 網絡服務器架設(Windows Server+Linux Server)
- 空間機器人遙操作系統及控制
- 智能工業報警系統
- 機器學習流水線實戰
- 系統安裝與重裝
- JSP從入門到精通
- FPGA/CPLD應用技術(Verilog語言版)
- Hands-On Dashboard Development with QlikView
- 傳感器原理與工程應用
- Data Analysis with R(Second Edition)
- Machine Learning with Spark(Second Edition)
- 智能+:制造業的智能化轉型
- Generative Adversarial Networks Projects
- 渲染王3ds Max三維特效動畫技術
- ROS Robotics By Example(Second Edition)