Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Maven 3.9.12 compatibility: Missing prerequisitesCheckers dependency in ArtifactoryEclipsePluginManager component #841

@TrueBurn

Description

@TrueBurn

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

Testing

After applying the fix, the component should work correctly with both Maven 3.9.11 (backward compatible) and Maven 3.9.12+.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions