Skip to content

2.20.* -DallowMajorUpdates=false has bug #1331

Closed

Description

@HelloDhero

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)

Activity

  1. andrzejj0 commented on Jan 10, 2026

    @andrzejj0
    Contributor

    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.

  2. added theissue type on Jan 10, 2026
  3. added a commit that references this issue on Jan 11, 2026
  4. added a commit that references this issue on Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions