TrueBurn commented on issue #11574:
URL: https://github.com/apache/maven/issues/11574#issuecomment-3669205240
## Root Cause Identified: JFrog Build-Info Extractor Component Configuration
I've identified the root cause of this NullPointerException when using the
Artifactory plugin.
### The Issue
The JFrog build-info-extractor replaces Maven's
`DefaultMavenPluginManager` with its own implementation
(`ArtifactoryEclipsePluginManager`) but doesn't declare the new
`prerequisitesCheckers` field as a Plexus component dependency.
**File:**
`build-info-extractor-maven3/src/main/resources/META-INF/plexus/components.xml`
The component configuration declares many requirements but is missing:
```xml
<requirement>
<role>java.util.List</role>
<field-name>prerequisitesCheckers</field-name>
</requirement>
```
When Plexus performs dependency injection, it leaves prerequisitesCheckers
as null, causing the NPE at DefaultMavenPluginManager.java:290.
Why This Only Affects Artifactory Builds
The JFrog extractor uses Plexus components.xml to replace the standard
DefaultMavenPluginManager implementation. Regular Maven builds use the standard
implementation where all fields are properly initialized.
Resolution Paths
1. Maven side: Add a null-check in checkPrerequisites() for backward
compatibility with older plugins/extensions that may not have this field
injected
2. JFrog side: Update their components.xml to declare the new dependency
(I've filed an issue at https://github.com/jfrog/build-info/issues)
Related Issue
- JFrog build-info issue: https://github.com/jfrog/build-info/issues/841
The null-check would be a good defensive measure since other third-party
Maven extensions that extend DefaultMavenPluginManager may have the same issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]