To configure a build system, there needs to be configure JDK, ANT/MAVEN, SCM configuration details, automating build options email notifications and other important things. Below are the steps to be followed in order to configure the same. In the below case we have considered the project to be a Maven Project.
要配置构建系统,需要配置JDK,ANT / MAVEN,SCM配置详细信息,自动构建选项电子邮件通知和其他重要内容。 以下是配置步骤。 在以下情况下,我们认为该项目是Maven项目。
- Deploy and start the Jenkins server and from the home page, click on New Item.
New Item - Then click on OK. Now a new page will be displayed where the details of JDK, ANT/Maven, SCM, automating build options, email notifications can be configured.
然后单击确定。 现在将显示一个新页面,可在其中配置JDK,ANT / Maven,SCM,自动生成选项,电子邮件通知的详细信息。
(Jenkins: Configuring SCM)
In order to configure the SCM for the build system, under the "Source Code Management" system, select the required SCM option for your required project and provide the details accordingly.
为了为构建系统配置SCM,请在“源代码管理”系统下,为所需项目选择所需的SCM选项,并提供相应的详细信息。
Note :
注意:在Jenkins中可以配置多个存储库URL。
(Jenkins: Configuring Build Triggers)
Jenkins proved multiple options to trigger the builds. Below are the same :
詹金斯证明了多种选择来触发构建。 以下是相同的:
- Build whenever a SNAPSHOT dependency is built
每当构建SNAPSHOT依赖项时都进行构建 - Trigger builds remotely (e.g., from scripts)
远程触发构建(例如,通过脚本) - Build after other projects are built
在其他项目建成后建造 - Build periodically (Runs on CRON job)
定期构建(在CRON作业上运行) - Poll SCM (Runs on CRON job)
轮询SCM(在CRON作业上运行)
User can configure multiple options from the above list. Below screen shot shows how to configure a build based on a CRON job (by selecting the option Build Periodically)
用户可以从上面的列表中配置多个选项。 下面的屏幕截图显示了如何基于CRON作业配置构建(通过选择“定期构建”选项)
The above mentioned CRON expression triggers build on 5 AM and 10 PM every day, every month repeatedly!
上面提到的CRON表达式触发器每天每天凌晨5点和晚上10点构建!
(Jenkins: Configuring Maven)
For any maven project to be built in Jenkins, the entry point is the pom.xml. The easy way to configure a project's build is to point to the pom.xml of the project as shown below :
对于要在Jenkins中构建的任何Maven项目,入口都是pom.xml。 配置项目构建的简单方法是指向项目的pom.xml,如下所示:
Also, there are many other options which can also be configure here as shown above.
另外,还有许多其他选项也可以在此处进行配置,如上所示。
(Jenkins: Configuring Maven Build Settings)
Jenkins provides the feature to configure the notification service by sending the mails configured for every build runs. It can be configured a shown below :
Jenkins提供了通过发送为每次构建运行配置的邮件来配置通知服务的功能。 可以配置如下所示:
(Jenkins: Configuring Post build activities)
Jenkins also provides feature to configure activities that needs to be executed post build. Below are the options available :
Jenkins还提供了用于配置需要在构建后执行的活动的功能。 以下是可用的选项:
- Aggregate downstream test results.
汇总下游测试结果。 - Archive the artifacts.
存档工件。 - Build other projects.
建立其他项目。 - Deploy artifacts to maven repository.
将工件部署到Maven存储库。 - Record fingerprints of files to track usage.
记录文件指纹以跟踪使用情况。
翻译自: https://www.studytonight.com/jenkins/configuring-build-system