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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7
    • 2.0.8, 3.0-alpha-1
    • None
    • 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
          Herve Boutemy

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              brianf Brian E Fox
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: