Jenkins: Create a freestyle job

This guide will show you how to set up your first freestyle job in Jenkins. You will use Jenkins to download Java source code from GitHub, compile the code using Maven, and view the build output.

What is a Jenkins freestyle job?

A Jenkins freestyle job is the most flexible type of job that you can do. A Freestyle job allows you to build any project. For example, you can do a Maven build, run a script, and so much more. Jenkins provides the freestyle job option by default without the need to install more plugins.

Let’s create a freestyle job!

First, create a new Freestyle job. You can do this by clicking: Jenkins -> New Item.

Next, enter a name for your Freestyle job and choose the “Freestyle Project” option.

Finally, this will take you to the configuration page for the new Freestyle job you have just created.

Next in the “Source Code Management” section:

Next in the “Build Environment” section:

  • Tick the “Add timestamps to the Console Output” option.

Next, in the “Build” section, click the “Add build step” button.

Finally, add “Invoke top-level Maven targets” and specify “package” as the goal.

Now click the “save” button. You will now see the dashboard for this job.

Run your freestyle job

You can run your freestyle job by clicking on the “build now” button in the job’s dashboard.

Jenkins will then display the build history below.

View the job’s console logs

You can then click on the build history job number (#1 – in this case) to view more information about the specific job that ran.

Next, click the console output option to see the job log.

View the job’s output files

Next, click the “workspace” button to view the files created by this job.

You can then download the files if needed:

Wrapping up

You can do a lot more in a job. For example, you could add post-build triggers to do coverage or archive the build. The possibilities are endless. But, you now know how to set up a Jenkins freestyle job.

You may also be interested in

About Anto Online

Anto, a seasoned technologist with over two decades of experience, has traversed the tech landscape from Desktop Support Engineer to enterprise application consultant, specializing in AWS serverless technologies. He guides clients in leveraging serverless solutions while passionately exploring cutting-edge cloud concepts beyond his daily work. Anto's dedication to continuous learning, experimentation, and collaboration makes him a true inspiration, igniting others' interest in the transformative power of cloud computing.

View all posts by Anto Online

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.