This is an automated email from the ASF dual-hosted git repository. hboutemy pushed a commit to branch MNG-7118 in repository https://gitbox.apache.org/repos/asf/maven.git
commit 591e9f19fac81c028b70ad0cdb40a4bd8cfd5efd Author: Hervé Boutemy <hbout...@apache.org> AuthorDate: Sat Mar 13 18:00:59 2021 +0100 [MNG-7117] add support for blocked mirror --- .../aether/DefaultRepositorySystemSessionFactory.java | 4 ++-- maven-settings/pom.xml | 2 +- maven-settings/src/main/mdo/settings.mdo | 13 +++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java b/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java index 86cb551..bbefc61 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java +++ b/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java @@ -188,8 +188,8 @@ public class DefaultRepositorySystemSessionFactory 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 ); diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml index 83288e5..4405e5c 100644 --- a/maven-settings/pom.xml +++ b/maven-settings/pom.xml @@ -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> diff --git a/maven-settings/src/main/mdo/settings.mdo b/maven-settings/src/main/mdo/settings.mdo index 333d8bd..003abe6 100644 --- a/maven-settings/src/main/mdo/settings.mdo +++ b/maven-settings/src/main/mdo/settings.mdo @@ -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 block any download request and fail the download process, explaining why. + </description> + </field> </fields> <codeSegments> <codeSegment> @@ -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(); }