-
Notifications
You must be signed in to change notification settings - Fork 163
Description
Summary
The build-info-extractor-maven3 fails with Maven 3.9.12 due to a missing Plexus component dependency declaration. Maven 3.9.12 added a new required field prerequisitesCheckers to DefaultMavenPluginManager, but the JFrog extractor's component configuration doesn't declare this dependency, causing a NullPointerException.
Environment
- Maven Version: 3.9.12
- Build-info-extractor Version: 2.42.2 (and likely all versions up to 2.43.5)
- Java Version: Affects Java 21, 25 (all versions)
- JFrog CLI: Latest versions
Error
[main] ERROR org.apache.maven.cli.MavenCli - Cannot invoke "java.util.List.forEach(java.util.function.Consumer)" because "this.prerequisitesCheckers" is null
java.lang.NullPointerException: Cannot invoke "java.util.List.forEach(java.util.function.Consumer)" because "this.prerequisitesCheckers" is null
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.checkPrerequisites (DefaultMavenPluginManager.java:290)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:187)
Root Cause
Maven 3.9.12 introduced plugin prerequisite checking in PR #11479, which added a prerequisitesCheckers field to DefaultMavenPluginManager.
The JFrog build-info-extractor replaces Maven's DefaultMavenPluginManager with ArtifactoryEclipsePluginManager (which extends DefaultMavenPluginManager), but the Plexus component configuration doesn't declare prerequisitesCheckers as a required dependency.
File: build-info-extractor-maven3/src/main/resources/META-INF/plexus/components.xml
Lines: 38-103
When Plexus performs dependency injection, it leaves prerequisitesCheckers as null, causing the NPE when Maven 3.9.12 tries to iterate over it.
The Fix
Add the following requirement to the DefaultMavenPluginManager component in components.xml (around line 101, after pluginValidationManager):
<requirement>
<role>java.util.List</role>
<field-name>prerequisitesCheckers</field-name>
</requirement>Verification
- ✅ Works with Maven 3.9.11 (field doesn't exist)
- ❌ Fails with Maven 3.9.12 (field exists but not injected)
- ❌ Fails on Java 21 and Java 25
- ❌ Affects all builds using JFrog Maven integration
Workaround
Until a fix is released, users must pin to Maven 3.9.11:
maven:3.9.11-amazoncorretto-25-al2023
Related Issues
- Maven issue: prerequisitesCheckers is throwing a NPE apache/maven#11574
- Maven PR that introduced the field: Allow a Maven plugin to require a Java version apache/maven#11479
Testing
After applying the fix, the component should work correctly with both Maven 3.9.11 (backward compatible) and Maven 3.9.12+.