[SCM-833] getLastChangedRevision() returns null whereas as getRevision() get correct versions
- Dominant language
- Java
- Stars
- 104
- Forks
- 189
- Avg merge
- 17h 46m
- Merged PRs (30d)
- 6
Description
**[Karl Heinz Marbaise](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=khmarbaise)** opened **[SCM-833](https://issues.apache.org/jira/browse/SCM-833?redirect=false)** and commented
Currently there is a method like this in the code (buildnumber-maven-plugin): AbstractScmMojo.java:
```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 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 ?
---
**Affects:** 1.9.4, 1.9.5
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the AbstractScmMojo.java getScmRevision() code shown in the issue, comparing the getRevision() and getLastChangedRevision() paths and the InfoItem values returned by the SCM implementation. Trace the relevant SCM info result and determine whether the null value is an SCM bug or buildnumber-maven-plugin misuse; done means the behavior is resolved and covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100