Build Step Invoke top-level Maven targets does not show version dropdown

Article ID:212341468
1 minute readKnowledge base

Issue

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.

top_level_maven_target.png

Environment

  • CloudBees Jenkins Enterprise

Resolution

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.

mvn_version.png

Then simply add the Maven installation(s) in the Jenkins configuration — this is where you will need to place the MAVEN_HOME path.

maven_installations.png

Alternatively, you can let Jenkins install the latest version of Maven automatically.

new_maven_installation.png

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.

maven_config.png