Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-2961

DefaultArtifact getBaseVersion is changed to "xxxx-SNAPSHOT" only if you first call isSnapshot()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7
    • Fix Version/s: 2.0.8, 3.0-alpha-1
    • Labels:
      None
    • Flags:
      Patch

      Description

      calling isSnapshot() actually modifies the baseVersion:

      public boolean isSnapshot()
      {
      if ( version != null || baseVersion != null )
      {
      Matcher m = VERSION_FILE_PATTERN.matcher( getBaseVersion() );
      if ( m.matches() )

      { setBaseVersion( m.group( 1 ) + "-" + SNAPSHOT_VERSION ); return true; }

      else

      { return getBaseVersion().endsWith( SNAPSHOT_VERSION ) || getBaseVersion().equals( LATEST_VERSION ); }

      }
      else

      { return false; }

      }

        Attachments

        1. MNG-2961.diff
          2 kB
          Hervé Boutemy

          Issue Links

            Activity

              People

              • Assignee:
                jdcasey John Casey
                Reporter:
                brianf Brian Fox
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: