• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Jenkins | New Job
  1. Maven configuration
  2. New Job
  3. General tab
  4. Source Code Management tab
  5. Build tab

  1. Maven configuration
    You need to configure the settings.xml file that you need to put in the "/var/lib/jenkins/.m2/" folder.

    Prerequisites:
    • Install Apache Maven
    • Install and configure Subversion
    • Install and configure Nexus Repository Manager
    • Install and configure SonarQube
  2. New Job
    To create a new Job:
    • Click the "New Item" link.
    • Enter the item name: "mtitek-svn-test-a".
    • Select the "Freestyle project".
    • Click the "OK" button.

    New Item

  3. General tab
    • Select the "General" tab.
    • Click the "Advanced" button.
    • Check the "Discard old builds" checkbox.
      A new section (Strategy) will open to let you configure how the old builds should be discarded:
      • Click the "Advanced" button.
      • Select "Log Rotation"
      • Days to keep builds: 1
      • Max # of builds to keep: 1
      • Days to keep artifacts: 1
      • Max # of builds to keep with artifacts: 1

    General tab

  4. Source Code Management tab
    • Select the "Source Code Management" tab.
    • Select "Subversion".
      A new section (Modules) will open to let you configure Subversion:
      • Repository URL: http://localhost/svn/myproject/mtitek-svn-test/trunk/mtitek-svn-test-a
      • Click the "Add" button and select "Jenkins" to add subversion credentials.

        Subversion credentials

      • Credentials: select the created credential.

    Source Code Management

  5. Build tab
    • Select the "Build" tab.
    • Click the "Add build step" and select "Invoke top-level Maven targets".
      A new section (Invoke top-level Maven targets) will open to let you configure Maven:
      • Maven Version: select any of the already installed maven versions ("apache-maven-3.6.2").
      • Goals: clean deploy
    • Click again the "Add build step" and select "Invoke top-level Maven targets".
      A new section (Invoke top-level Maven targets) will open to let you configure Maven:
      • Maven Version: select any of the already installed maven versions ("apache-maven-3.6.2").
      • Goals: sonar:sonar

    Build

    Note that you may get this error when Jenkins build your project:

    To fix this error go SonarQube (http://localhost:9000/)
    • Click on "Administration"
    • Click on "Configuration" dropdown and select "General Settings"
    • Click on "SCM"
    • Set a "true" the "Disable the SCM Sensor"
    • Click on "Save"

    Disable the SCM Sensor - SonarQube

© 2025  mtitek