Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31231

Invalid snapshot version will cause Maven metadata rebuild process to fail with NullPointerException

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.37.3
    • Fix Version/s: None
    • Component/s: Maven
    • Notability:
      3

      Description

      The MetadataBuilder appears to only account for cases where the version string is a well-formed.  If not, it will assume the version is timestamped and try to accumulate the pertinent snapshots to find the latest version.  This leads to an NPE.

      For example, a version string of "7.9.0-3-7.9.0-3-SNAPSHO-" will cause the following NPE:

      java.lang.NullPointerException: null
      {{ at org.sonatype.nexus.repository.maven.internal.hosted.metadata.MetadataBuilder.onExitBaseVersion(MetadataBuilder.java:256)}}
      {{ at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder$OrientWorker.refreshVersion(OrientMetadataRebuilder.java:452)}}
      {{ at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder$OrientWorker.lambda$6(OrientMetadataRebuilder.java:339)}}
      {{ at org.sonatype.nexus.transaction.OperationPoint.proceed(OperationPoint.java:64)}}
      {{ at org.sonatype.nexus.transaction.Operations.transactional(Operations.java:217)}}
      {{ at org.sonatype.nexus.transaction.Operations.call(Operations.java:166)}}
      {{ at org.sonatype.nexus.repository.maven.internal.orient.OrientMetadataRebuilder$OrientWorker.lambda$5(OrientMetadataRebuilder.java:339)}}
      ...

      This causes the whole rebuild to fail. 

      Expected

      Invalid versions should be logged at WARN level but skipped to allow processing to continue.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jkruger John Kruger
            Last Updated By:
            Grace Lee Grace Lee
            Team:
            NXRM - Mad Max
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title