Skip to content

Commit

Permalink
[MNG-7117] add support for blocked mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Mar 19, 2021
1 parent fa79cb2 commit 899465a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ else if ( request.isUpdateSnapshots() )
DefaultMirrorSelector mirrorSelector = new DefaultMirrorSelector();
for ( Mirror mirror : request.getMirrors() )
{
mirrorSelector.add( mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirror.getMirrorOf(),
mirror.getMirrorOfLayouts() );
mirrorSelector.add( mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirror.isBlocked(),
mirror.getMirrorOf(), mirror.getMirrorOfLayouts() );
}
session.setMirrorSelector( mirrorSelector );

Expand Down
2 changes: 1 addition & 1 deletion maven-settings/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ under the License.
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<configuration>
<version>1.1.0</version>
<version>1.2.0</version>
<models>
<model>src/main/mdo/settings.mdo</model>
</models>
Expand Down
13 changes: 13 additions & 0 deletions maven-settings/src/main/mdo/settings.mdo
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,15 @@
of the mirror to repositories with a matching layout (apart from a matching id). Since Maven 3.
</description>
</field>
<field>
<name>blocked</name>
<version>1.2.0+</version>
<type>boolean</type>
<defaultValue>false</defaultValue>
<description>
Whether this mirror should be blocked from any download request but fail the download process, explaining why.
</description>
</field>
</fields>
<codeSegments>
<codeSegment>
Expand All @@ -648,6 +657,10 @@
sb.append( ",mirrorOf=" ).append( mirrorOf );
sb.append( ",url=" ).append( this.url );
sb.append( ",name=" ).append( this.name );
if ( isBlocked() )
{
sb.append( ",blocked" );
}
sb.append( "]" );
return sb.toString();
}
Expand Down

0 comments on commit 899465a

Please sign in to comment.