You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2021/03/15 07:33:15 UTC

[maven] branch MNG-7118 updated (0417b36 -> 0482052)

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a change to branch MNG-7118
in repository https://gitbox.apache.org/repos/asf/maven.git.


 discard 0417b36  [MNG-7118] Block HTTP repositories by default
 discard f0516cf  [MNG-7117] Add support for blocking mirrors
     new 591e9f1  [MNG-7117] add support for blocked mirror
     new 0482052  [MNG-7118] block HTTP repositories by default

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (0417b36)
            \
             N -- N -- N   refs/heads/MNG-7118 (0482052)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 apache-maven/src/assembly/maven/conf/settings.xml                   | 2 +-
 .../internal/aether/DefaultRepositorySystemSessionFactory.java      | 2 +-
 maven-settings/src/main/mdo/settings.mdo                            | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)


[maven] 01/02: [MNG-7117] add support for blocked mirror

Posted by hb...@apache.org.
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 <hb...@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();
     }


[maven] 02/02: [MNG-7118] block HTTP repositories by default

Posted by hb...@apache.org.
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 04820522589ae7741a3371570287f77c853ec65a
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sat Mar 13 19:03:43 2021 +0100

    [MNG-7118] block HTTP repositories by default
---
 apache-maven/src/assembly/maven/conf/settings.xml | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/apache-maven/src/assembly/maven/conf/settings.xml b/apache-maven/src/assembly/maven/conf/settings.xml
index b5a5a03..2f18af3 100644
--- a/apache-maven/src/assembly/maven/conf/settings.xml
+++ b/apache-maven/src/assembly/maven/conf/settings.xml
@@ -43,9 +43,9 @@ under the License.
  | values (values used when the setting is not specified) are provided.
  |
  |-->
-<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
+<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 https://maven.apache.org/xsd/settings-1.1.0.xsd">
+          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
   <!-- localRepository
    | The path to the local repository maven will use to store artifacts.
    |
@@ -156,6 +156,13 @@ under the License.
       <url>http://my.repository.com/repo/path</url>
     </mirror>
     -->
+    <mirror>
+      <id>maven-default-http-blocker</id>
+      <mirrorOf>external:http:*</mirrorOf>
+      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
+      <url>http://0.0.0.0/</url>
+      <blocked>true</blocked>
+    </mirror>
   </mirrors>
 
   <!-- profiles