DevOps/Cloud By GK
  • DevOps/Cloud Introduction
  • 🚩AWS
    • Create AWS Account
    • Launch EC2 Instance
  • 🚩Linux
    • User Managment
      • Adding the User to Sudo group
      • visudo
    • Directory / File Management
      • Vi
      • Changing Permissions (chmod)
      • Filtering IO/File
    • Memory Management
    • Process Management
    • Network Management
    • Service Management
    • Environmental Variables
      • $PATH
    • Utilities
    • SHELL PROGRAMMING
      • Hello World
      • Variables
      • Command Line arguments
      • Conditional Statements
      • Array
      • Loops
      • Functions
      • AWK
      • sed
      • Example Useful Scripts
      • Basic -> Advanced
  • 🚩git
    • Introduction
    • Creating GitHub Account
    • Installation
      • Git Bash In Windows
      • Git In VS Code
      • Git In Eclipse
      • Git CLI in Linux
  • Creating Git Remote Repository
  • Git Commands L -> R
  • Git Commands L <- R
  • Git Branch Commands
  • Using SSH (Password Less)
  • 🚩maven
    • Introduction
    • Installation
    • POM.xml
    • Goals
  • 🚩SonarQube
    • Introduction
    • Sonar Cloud
    • Creating Project In SonarCloud
    • Installing Sonar-Scanner
    • Triggering Scan
  • 🚩Nexus
    • Introduction
    • Installation of Nexus
    • Creating Repository
    • Uploading Artifacts to Repository
  • 🚩Jenkins
    • Introduction
    • Installation of Jenkins
    • First Job In Jenkins
    • Git + Jenkins
      • WebHook
    • Maven + Jenkins
    • Sonar-Scanner + Jenkins
    • Nexus + Jenkins
Powered by GitBook
On this page
  1. Jenkins

Maven + Jenkins

To integrate Maven with Jenkins, follow these steps:

  1. Install the Maven Integration plugin:

    • Access the Jenkins web interface.

    • Click on "Manage Jenkins" in the left-hand side menu.

    • Select "Manage Plugins" from the dropdown.

    • Navigate to the "Available" tab.

    • Search for "Maven Integration" in the filter box.

    • Check the box next to "Maven Integration" plugin.

    • Click on the "Install without restart" button.

  2. Configure the Maven installation in Jenkins:

    • Go back to the Jenkins dashboard.

    • Click on "Manage Jenkins" in the left-hand side menu.

    • Select "Global Tool Configuration" from the dropdown.

    • Scroll down to the "Maven" section.

    • Click on "Add Maven".

    • Provide a name for the Maven installation (e.g., "Maven 3.x.x").

    • Specify the MAVEN_HOME directory or let Jenkins install it for you.

    • Click on the "Save" button.

  3. Create a new Jenkins job:

    • On the Jenkins dashboard, click on "New Item" on the left-hand side.

    • Enter a name for your job and select "Freestyle project".

    • Click "OK" to proceed.

  4. Configure the job:

    • Source Code Management: Select the appropriate SCM (e.g., Git, Subversion) and configure the repository details.

    • Build section: Add a build step by clicking on the "Add build step" dropdown and selecting "Invoke top-level Maven targets".

    • Maven Version: Choose the Maven installation you configured in step 2.

    • Goals: Enter the Maven goals you want to execute (e.g., clean install).

    • POM: Specify the path to the POM file relative to the repository root (e.g., pom.xml).

    • Save the job configuration.

  5. Build the job:

    • On the Jenkins dashboard, click on the job name to navigate to its details page.

    • Click on "Build Now" to trigger the build.

Jenkins will now execute the Maven goals specified in the job configuration, using the configured Maven installation. You can view the build output, check the build status, and access other features provided by Jenkins for continuous integration and delivery.

By integrating Maven with Jenkins, you can automate your build and deployment processes, execute Maven goals, generate reports, and manage dependencies in your projects.

PreviousWebHookNextSonar-Scanner + Jenkins

Last updated 2 years ago

🚩