Maven JDK Toolchains

Hello community.
I’m building a Maven project, and I’m getting an error when I want to build with an older version of Java, which is necessary to build that application.
The solution in the log is to install the plugin that I attached in the attached image, but I see that this plugin does not exist.
Any other solution? Thank you,

I’d recommend refactoring your maven project to a pipeline and specifying the maven and Java version you want to use. That way, you have full control over the Java and maven version to use.

I agree with @NotMyFault that you should not use the Maven project type. The Maven project type in Jenkins is implemented by the Maven integration plugin. The Maven integration plugin includes the following warning text in its documentation:

Refer to the video from Darin Pope for a tutorial

1 Like

Thanks @MarkEWaite Would this shell model be correct to start with?

#!/bin/bash

# Define variables
MAVEN_HOME=/path/to/your/maven/installation
JAVA_HOME=/path/to/your/java8/installation
PROJECT_REPO_URL=https://url/of/your/repository.git
REPO_BRANCH=branch-name

# Set up environment
export PATH=$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH

# Clone the repository
git clone $PROJECT_REPO_URL
cd repository-name

# Switch to the specified branch
git checkout $REPO_BRANCH

# Compile with Maven
mvn clean install

# If you want to run tests, you can add the following command
# mvn test

# The resulting .war files will be in the 'target' directory
# You can perform other actions according to your needs, such as deploying the application, etc.

# Finish and clean up
cd ..
rm -rf repository-name

# Exit successfully
exit 0