Skip to content

Commit

Permalink
[MRELEASE-1079] restore test as it was before MRELEASE-998
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed May 28, 2022
1 parent e8acf3a commit 6a6ac83
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,20 @@ public interface ReleaseDescriptor
/**
* <p>getOriginalScmInfo.</p>
*
* @return the original {@code Scm} information.
* @param projectKey the project key {@code String}
* @return the original {@code Scm} information.
*/
Scm getOriginalScmInfo( String projectKey );

/**
* <p>hasOriginalScmInfo.</p>
*
* @param projectKey the project key {@code String}
* @return has original Scm info.
*/
boolean hasOriginalScmInfo( String projectKey );


// Modifiable
/**
* <p>addDependencyOriginalVersion.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected void transformScm( MavenProject project, Model modelTarget, ReleaseDes
// If the SCM element is not present, only add it if the parent was not mapped (ie, it's external to
// the release process and so has not been modified, so the values will not be correct on the tag),
String parentId = ArtifactUtils.versionlessKey( parent.getGroupId(), parent.getArtifactId() );
if ( releaseDescriptor.getOriginalScmInfo( parentId ) == null )
if ( !releaseDescriptor.hasOriginalScmInfo( parentId ) )
{
// we need to add it, since it has changed from the inherited value
scmRoot = new Scm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected void transformScm( MavenProject project, Model modelTarget, ReleaseDes
// If the SCM element is not present, only add it if the parent was not mapped (ie, it's external to
// the release process and so has not been modified, so the values will not be correct on the tag),
String parentId = ArtifactUtils.versionlessKey( parent.getGroupId(), parent.getArtifactId() );
if ( releaseDescriptor.getOriginalScmInfo( parentId ) == null )
if ( !releaseDescriptor.hasOriginalScmInfo( parentId ) )
{
// we need to add it, since it has changed from the inherited value
Scm scmTarget = new Scm();
Expand Down
14 changes: 12 additions & 2 deletions maven-release-manager/src/main/mdo/release-descriptor.mdo
Original file line number Diff line number Diff line change
Expand Up @@ -719,13 +719,23 @@
/**
* Method getOriginalScmInfo.
*
* @return Map
* @return Scm
*/
public org.apache.maven.model.Scm getOriginalScmInfo( String id )
{
return this.originalScmInfo.get( id );
} //-- java.util.Map<Object, String> getOriginalScmInfo()
} //-- Scm getOriginalScmInfo( String)
/**
* Method hasOriginalScmInfo.
*
* @return map contains
*/
public boolean hasOriginalScmInfo( String id )
{
return this.originalScmInfo.containsKey( id );
} //-- boolean hasOriginalScmInfo( String )
/**
* Method addOriginalScmInfo.
*
Expand Down

0 comments on commit 6a6ac83

Please sign in to comment.