You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when use version 2.20.* and -DallowMajorUpdates=false and config ignoreVersion by rule in maven-version-rules.xml i get the fllow exception
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.maven.artifact.versioning.ArtifactVersion.toString()" because "artifactVersion" is null
at org.codehaus.mojo.versions.ordering.BoundArtifactVersion.<init> (BoundArtifactVersion.java:82)
at org.codehaus.mojo.versions.api.AbstractVersionDetails.lambda$restrictionForUnchangedSegment$0 (AbstractVersionDetails.java:161)
at java.util.Optional.map (Optional.java:260)
at org.codehaus.mojo.versions.api.AbstractVersionDetails.restrictionForUnchangedSegment (AbstractVersionDetails.java:160)
at org.codehaus.mojo.versions.internal.DependencyUpdatesLoggingHelper.getDependencyUpdates (DependencyUpdatesLoggingHelper.java:133)
at org.codehaus.mojo.versions.DisplayDependencyUpdatesMojo.logUpdates (DisplayDependencyUpdatesMojo.java:555)
at org.codehaus.mojo.versions.DisplayDependencyUpdatesMojo.execute (DisplayDependencyUpdatesMojo.java:478)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
Are you able to share a minimal pom.xml that triggers this issue?
The reason why I'm asking this is that I suspect that you're using a dependency expressed as a version range and due to ignoredVersions, there are actually no versions being selected.
-DallowMajorUpdates=false activates a path in the code that leads to this NPE (which I'll fix in a tiny PR here), but I see that it is present in versions prior to 2.20.x.
Did it work for you with previous versions of the plugin? What was the output?
Ideally, a dependency causing a problem or a whole minimal pom.xml would be very helpful please.
Activity
andrzejj0 commentedon Jan 10, 2026
Are you able to share a minimal pom.xml that triggers this issue?
The reason why I'm asking this is that I suspect that you're using a dependency expressed as a version range and due to ignoredVersions, there are actually no versions being selected.
-DallowMajorUpdates=false activates a path in the code that leads to this NPE (which I'll fix in a tiny PR here), but I see that it is present in versions prior to 2.20.x.
Did it work for you with previous versions of the plugin? What was the output?
Ideally, a dependency causing a problem or a whole minimal pom.xml would be very helpful please.
mojohaus#1331: Fix NPE in restrictionForUnchangedSegment if actual ve…
#1331: Fix NPE in restrictionForUnchangedSegment if actual version is…