Open In App

Creating And Configuring Freestyle Projects In Jenkins

Last Updated : 27 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Jenkins freestyle project is the general purpose job that will clone the projects from the Source Code Management (SCM) like Github, Gitlab, and Bit Bucket. After according to the configurations done to the project it will execute the steps in a series of manner like archiving the artifacts and sending the email notifications etc.

What is Jenkins Freestyle Project?

In Jenkins Freestyle project is a basic and simple way to create and build the jobs of any type of application. Jenkins freestyle project will support many automation tasks because of its flexibility of use. In the term itself, it is freestyle which means the configuration of the project is very simple it is less structured and more flexible to use when compared to the other projects in Jenkins.

Types Of Projects Available in Jenkins

In Jenkins three are mainly used projects

  • Freestyle project
  • Pipeline project
  • Multiconfiguration Project

1. Freestyle Project

It is the most used project because of its structure which is simpler than complicated. For this project there is no need for any scripting language or no need of coding skills by using the console itself self you can do all the configurations needed for the project which will save lots of time and effort for the employees.

2. Pipeline Project

DevOps professionals mostly work with pipelines because pipelines can automate processes like building, testing, and deploying the application. Doing it manually by UI takes lots of time and effort which will affect productivity. With the help of Continuous Integration / Continuous Deployment (CI/CD) Pipeline scripts we can automate the whole process which will increase productivity and save lots of time for the organization and can deliver quality applications to the end users.

Read – How to Make a CI-CD Pipeline in Jenkins?

3. Multiconfiguration Project

In Jenkins, a Multiconfiguration Project—also called a Matrix Project—is a project type that enables you to execute a build or series of concurrent builds on several configurations or axes. When you need to test your software or run builds across several platforms, environments, or settings, this kind of project is quite helpful.

Step-by-step Process To Setup Jenkins FreeStyle Project

Step 1: Access Jenkins from the internet and log in by using the credentials as shown below.

Jenkins UI

Step 2: Give the name of the project and slect the freestyle project as show in the image below. Ans click on ok after selecting.

Freestyle project

Step 3: Know one page will open as show in the image below where you need to configure all the required configurations required for the project which you want to build.

Configurations

In this page you need to configure all the details required for the project to build and deploy the application.

Step 4: While configuring the freestyle project you need to give the credentials and repository URL so that jenkins can clone the source code from your github. In the place of repository URL paste your github url and in the place of credentials click on the add credentials and follow the proceses shown in the step 5.

General

Step 5: After clicking on the +Add option a pop up will open in that pop up select the kind as “username with password” in the place of the user name give the name you wnat and in the place of password give the “ssh key” from the github.

GitHub Credentials

Step 6: Select the branch from which you want to clone the source code.

Select the branch

Step 6: In this project i was going to show how to build the maven project. So under the build section select the “Invoke top-level Maven Targets”. In that configure the maven version you have been configured in the jenkins pulgin in section here i have configured maven3.8.6 so i was giving that.

In the goal section give the goals here the goal was to build the package so use the maven command

clean package

No need of giving the “mvn” here in jenkins.

Maven Version

Step 7: Save the configuration and click on apply you will automatically redirecrted to the build page there click on the build know option.

Build Know

Step 8: Click on the job which is running where it will redirect to the console output you can see the status and the logs of the build.

Job

Step 9: Scroll down fully to see the status of the job where the jobs show sucess as shown below it is succed or if any errors occurs it will shows you in the same console output its slef do the debuging accordingly.

Jenkins Build Success

For me the build was success after doing it two to three times and reading console output and changing configurations accordingly. So read the console output properly it will give you the solution also.

People Also Read

  • How To Install JenkinsRead
  • How To Write Jnekins CI/CD pipelineRead

Conclusion

In this article we have jenkins to pull the source code and build the mave appliction by using the freestyle project. Freestyle project is the basic project whihc is regularly used in the jenkinsfor any type of project dependinf up on the need you can choose the different projects.

Jenkins Freestyle Project FAQ’s

What is the difference between Jenkins freestyle project and pipeline?

  • Jenkins freestyle Project: Configured using the Jenkins online console’s graphical user interface (UI). With a point-and-click interface, users configure build steps, post-build actions, and configurations.
  • Jenkins pipeline project: Permits the definition of build processes with both Groovy-based Scripted Pipeline, which has a more flexible and script-like syntax, and Declarative Pipeline, which has an opinionated and structured syntax. Versioning, teamwork, and treating build processes like code are all made possible by pipeline as code.

What are the 2 types of pipelines available in Jenkins?

The two type of pipelines which can be used in the jenkins was,

  • Scripted Pipeline
  • Declerative Pipeline



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads