官术网_书友最值得收藏!

  • 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:

  1. Click on create new jobs:
  1. Create a Jenkins job with the Maven plugin. Provide the job name devops-ci-cd (you can choose another project name, if you want):
  1. In the Source Code Management section, provide the Git URL of your project. Provide credentials to clone the repository in Jenkins:
  1. 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:
  1. 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:
  1. 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.

主站蜘蛛池模板: 平果县| 香河县| 竹北市| 读书| 朝阳市| 柳河县| 神池县| 通渭县| 石阡县| 抚州市| 泊头市| 焦作市| 涞水县| 黑龙江省| 抚顺县| 普兰县| 瓮安县| 阳曲县| 双峰县| 诸城市| 上林县| 德庆县| 偃师市| 扎鲁特旗| 乌兰县| 大竹县| 河西区| 静乐县| 年辖:市辖区| 海城市| 淅川县| 曲靖市| 新疆| 西丰县| 兖州市| 益阳市| 炎陵县| 汉川市| 湘阴县| 叙永县| 平罗县|