Skip to content

Commit 6da9fbe

Browse files
committed
[MRELEASE-1079] restore test as it was before MRELEASE-998
1 parent e4abd0f commit 6da9fbe

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

maven-release-api/src/main/java/org/apache/maven/shared/release/config/ReleaseDescriptor.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,20 @@ public interface ReleaseDescriptor
485485
/**
486486
* <p>getOriginalScmInfo.</p>
487487
*
488-
* @return the original {@code Scm} information.
489488
* @param projectKey the project key {@code String}
489+
* @return the original {@code Scm} information.
490490
*/
491491
Scm getOriginalScmInfo( String projectKey );
492492

493+
/**
494+
* <p>hasOriginalScmInfo.</p>
495+
*
496+
* @param projectKey the project key {@code String}
497+
* @return has original Scm info.
498+
*/
499+
boolean hasOriginalScmInfo( String projectKey );
500+
501+
493502
// Modifiable
494503
/**
495504
* <p>addDependencyOriginalVersion.</p>

maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected void transformScm( MavenProject project, Model modelTarget, ReleaseDes
9696
// If the SCM element is not present, only add it if the parent was not mapped (ie, it's external to
9797
// the release process and so has not been modified, so the values will not be correct on the tag),
9898
String parentId = ArtifactUtils.versionlessKey( parent.getGroupId(), parent.getArtifactId() );
99-
if ( releaseDescriptor.getOriginalScmInfo( parentId ) == null )
99+
if ( !releaseDescriptor.hasOriginalScmInfo( parentId ) )
100100
{
101101
// we need to add it, since it has changed from the inherited value
102102
scmRoot = new Scm();

maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected void transformScm( MavenProject project, Model modelTarget, ReleaseDes
9595
// If the SCM element is not present, only add it if the parent was not mapped (ie, it's external to
9696
// the release process and so has not been modified, so the values will not be correct on the tag),
9797
String parentId = ArtifactUtils.versionlessKey( parent.getGroupId(), parent.getArtifactId() );
98-
if ( releaseDescriptor.getOriginalScmInfo( parentId ) == null )
98+
if ( !releaseDescriptor.hasOriginalScmInfo( parentId ) )
9999
{
100100
// we need to add it, since it has changed from the inherited value
101101
Scm scmTarget = new Scm();

maven-release-manager/src/main/mdo/release-descriptor.mdo

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,13 +719,23 @@
719719
/**
720720
* Method getOriginalScmInfo.
721721
*
722-
* @return Map
722+
* @return Scm
723723
*/
724724
public org.apache.maven.model.Scm getOriginalScmInfo( String id )
725725
{
726726
return this.originalScmInfo.get( id );
727-
} //-- java.util.Map<Object, String> getOriginalScmInfo()
727+
} //-- Scm getOriginalScmInfo( String)
728728
729+
/**
730+
* Method hasOriginalScmInfo.
731+
*
732+
* @return map contains
733+
*/
734+
public boolean hasOriginalScmInfo( String id )
735+
{
736+
return this.originalScmInfo.containsKey( id );
737+
} //-- boolean hasOriginalScmInfo( String )
738+
729739
/**
730740
* Method addOriginalScmInfo.
731741
*

0 commit comments

Comments
 (0)