Skip to content

Fix NPE in DefaultModelBuilder when POM resolved from repository (backport to 4.0.x) - #12285

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
cherry-pick-11922-to-4.0.x
Jun 17, 2026
Merged

gnodet merged 1 commit into
maven-4.0.xfrom
cherry-pick-11922-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Backport of #11922 to maven-4.0.x.

Fix NullPointerException in readEffectiveModel() when inputModel has no local POM file (e.g. dependency POM resolved from a remote repository).

Fixes #11919

)

Fix NullPointerException in readEffectiveModel() when inputModel has no
local POM file (e.g. dependency POM resolved from a remote repository).

The relative path resolution for parent POMs called
inputModel.getPomFile().getParent() without checking for null, causing
an NPE when plugins like cyclonedx-maven-plugin resolve dependency
models. Add null guard for inputModel.getPomFile() and reorder the
isBuildRequest() check for short-circuit efficiency.

Fixes #11919
@gnodet gnodet added bug Something isn't working backport labels Jun 17, 2026
@gnodet
gnodet merged commit 32f9497 into maven-4.0.x Jun 17, 2026
23 checks passed
@gnodet
gnodet deleted the cherry-pick-11922-to-4.0.x branch June 17, 2026 07:18
@github-actions github-actions Bot added this to the 4.0.0-rc-6 milestone Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants