Assignment 1 Maven through jenkins
Assignment 1 Maven through jenkins
Install Jenkins on your server or local machine by following the installation instructions for your
operating system. You can find the installation guide on the official Jenkins website:
https://www.jenkins.io/doc/book/installing/
Once Jenkins is installed, open your web browser and navigate to http://localhost:8080
(assuming Jenkins is running on your local machine). Follow the initial setup wizard to configure
Jenkins.
Jenkins has a Maven plugin that allows you to easily build Maven projects. Install the Maven
plugin by going to Jenkins dashboard -> Manage Jenkins -> Manage Plugins -> Available tab,
then search for "Maven Integration" and install it.
Make sure Maven is installed on the machine where Jenkins is running. You can download
Maven from the official website: https://maven.apache.org/download.cgi
Once Maven is installed, configure the Maven installation in Jenkins by going to Jenkins
dashboard -> Manage Jenkins -> Global Tool Configuration -> Maven. Click on "Add Maven"
and provide the Maven installation details.
In the configuration page of your Jenkins job, under the "Source Code Management" section,
select Git and provide the repository URL of your Maven project.
Under the "Build" section, add a build step to invoke Maven. Select "Invoke top-level Maven
targets" from the dropdown menu.
In the "Goals" field, enter the Maven goals you want to execute (e.g., clean install).
Optionally, you can configure post-build actions, such as archiving artifacts or sending
notifications.
Once you've configured the Jenkins job, click on "Save" to save the configuration.
Click on "Build Now" to trigger a build of your Maven project. Jenkins will clone the repository,
build the project using Maven, and display the build output in the console.