Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-833

getLastChangedRevision() returns null whereas as getRevision() get correct versions

    XMLWordPrintableJSON

Details

    Description

      Currently there is a method like this in the code (buildnumber-maven-plugin): AbstractScmMojo.java:

          protected String getScmRevision()
              throws ScmException
          {
              ScmRepository repository = getScmRepository();
      
              InfoScmResult scmResult = info( repository, new ScmFileSet( scmDirectory ) );
      
              if ( scmResult == null || scmResult.getInfoItems().isEmpty() )
              {
                  return ( !StringUtils.isEmpty( revisionOnScmFailure ) ) ? revisionOnScmFailure : null;
              }
      
              checkResult( scmResult );
      
              InfoItem info = scmResult.getInfoItems().get( 0 );
              
              List<InfoItem> infoItems = scmResult.getInfoItems();
              
              for (InfoItem infoItem : infoItems) {
              	getLog().info("Item: " +infoItem.getRevision() + " lcr: "  + infoItem.getLastChangedRevision() );
      	}
      
              getLog().info("useLastCommittedRevision: " + useLastCommittedRevision);
              if ( useLastCommittedRevision )
              {
                  return info.getLastChangedRevision();
              }
      
              return info.getRevision();
          }
      

      The problem is simply that getLastChangedRevision() returns null whereas getRevision() returns the requested value?...

      So ATM I'm not sure if this is really a bug in SCM or a misusage in buildnumber-maven-plugin ?

      Attachments

        Activity

          People

            Unassigned Unassigned
            khmarbaise Karl Heinz Marbaise
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: