in a clean jenkins (no maven plugin installed)
In an agent without maven on the path add MAVEN_HOME to the environment variables for the node.
run the follwoing pipeline
This should work as MAVEN_HOME is in the environment as confimerd by the set command.
However it fails with the following message
[withMaven] use JDK installation provided by the build agent
$ where mvn.cmd
$ where mvn.bat
[withMaven] use Maven installation provided by the build agent with executable null
[Pipeline] // withMaven
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Could not find maven executable, please set up a Maven Installation or configure MAVEN_HOME or M2_HOME environment variable
But MAVEN_HOME is defined - so this is just plain wrong...