A Jenkins job configuration typically includes these main sections: General for job description and settings, Source Code Management for repository details, Build Triggers to define when the job runs, Build Environment for environment setup, Build for the actual build steps, and Post-build Actions for tasks after the build completes.
<project> <actions/> <description>Sample job</description> <keepDependencies>false</keepDependencies> <properties/> <scm class="hudson.scm.NullSCM"/> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers> <hudson.triggers.TimerTrigger> <spec>H/15 * * * *</spec> </hudson.triggers.TimerTrigger> </triggers> <concurrentBuild>false</concurrentBuild> <builders/> <publishers/> <buildWrappers/> </project>
The H/15 * * * *, which means the job is scheduled to run every 15 minutes.
The typical order in Jenkins freestyle job XML is: <scm> for source control, <triggers> for build triggers, <builders> for build steps, and <publishers> for post-build actions.
The
Storing job configurations as code in version control and generating jobs with Jenkins Job DSL or Pipeline scripts is best practice. It enables tracking changes, collaboration, and automated job creation. Manual UI changes or backups alone do not provide this level of control and consistency.