After a new Jenkins installation process (i.e. upgrading Jenkins via fresh installation, or installing a new Jenkins instance, etc), when trying to add and configure new items / projects / jobs, I see that the dropdown to select which Maven version to invoke is no longer there.
- CloudBees Jenkins Enterprise
This is usually a simple case of forgetting to ensure that you have added the Maven installation(s) you want to use on the new Jenkins instance config.
If you want to use an existing Maven installation on a new machine, you should first check to see if it exists. A quick check is to run
mvn -version in the terminal. This will also print out the “Maven home” (MAVEN_HOME) path, which you will need in the next step.
Then simply add the Maven installation(s) in the Jenkins configuration – this is where you will need to place the MAVEN_HOME path.
Alternatively, you can let Jenkins install the latest version of Maven automatically.
From here, if you go back to your item / project / job, you will find that when you go back to add a Build Step: Invoke top-level Maven targets, you will see the dropdown and the Maven version(s) you have added to Jenkins.