-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: maven-plugin
-
None
-
Environment:Windows
When configuring the Maven plugin to download and extract Maven from a ZIP file, the withMaven step fails with the following error:
11:56:36 [withMaven] Options: [org.jenkinsci.plugins.pipeline.maven.publishers.TasksScannerPublisher[disabled='true', healthy='', unHealthy='', thresholdLimit='low'], org.jenkinsci.plugins.pipeline.maven.publishers.DependenciesFingerprintPublisher[disabled=true, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}], org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher[disabled=true], JunitTestsPublisher[disabled=true,healthScaleFactor=,keepLongStdio=false,ignoreAttachments=false], org.jenkinsci.plugins.pipeline.maven.publishers.JGivenTestsPublisher[disabled=true], org.jenkinsci.plugins.pipeline.maven.publishers.InvokerRunsPublisher[disabled=true], org.jenkinsci.plugins.pipeline.maven.publishers.FindbugsAnalysisPublisher[disabled='true', healthy='', unHealthy='', thresholdLimit='low'], org.jenkinsci.plugins.pipeline.maven.publishers.ConcordionTestsPublisher[disabled=true], org.jenkinsci.plugins.pipeline.maven.publishers.PipelineGraphPublisher[disabled=true, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}, skipDownstreamTriggers=false, lifecycleThreshold=deploy, ignoreUpstreamTriggers=false]] 11:56:36 [withMaven] Available options: 11:56:36 [withMaven] using JDK installation 21.0.5+11 11:56:37 [withMaven] using Maven installation 'Maven' 11:56:37 [withMaven] failed to read Maven version: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null 11:56:37 [withMaven] WARNING: You are running an old version of Maven (UNKNOWN), you should update to at least 3.8.x
I download Maven from https://dlcdn.apache.org/maven/mvnd/1.0.3/maven-mvnd-1.0.3-windows-amd64.zip.
This ZIP archive contains a nested maven subfolder, and it seems the Jenkins Maven plugin does not handle this structure correctly.
Here is how I configured the Maven plugin:

The goal is to use a Nexus repository as a proxy by setting up a raw repository that points to the official Apache repository.
While I could manually repackage the ZIP to remove the extra subfolder and host it in a local repository, I’d prefer to avoid that approach, as it would require repackaging each time we upgrade Maven.