Pax URL

Mirrors do not replace the repos they mirror

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.3.5
  • Fix Version/s: 1.4.0.RC1
  • Component/s: aether
  • Labels:
    None

Description

Mirrored repos are not fully mirrored: they are still consulted directly. This really defeats the purpose of mirroring. In more detail, if a repo is mirrored, the mirror is added to the beginning of the list of remote repos, but the mirrored repo is left in the list. So for instance if you have configured your local nexus repo to block downloading of some urls, the presence of the original repo after the mirror will mean that the urls can be downloaded directly anyway.

Solution: remove the mirrored repos from the list of remote repos when adding the mirror.

Activity

Hide
David Jencks added a comment -

proposed change:

diff --git a/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java b/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java
index b911d7e..2c2093b 100644
— a/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java
+++ b/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java
@@ -122,6 +122,7 @@ public class AetherBasedResolver { mirroedRepos.add( naming.get( rep ) ); }
mirror.setMirroredRepositories( mirroedRepos );
+ m_remoteRepos.removeAll(mirroedRepos);
m_remoteRepos.add( 0, mirror );
}

Show
David Jencks added a comment - proposed change: diff --git a/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java b/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java index b911d7e..2c2093b 100644 — a/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java +++ b/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/internal/AetherBasedResolver.java @@ -122,6 +122,7 @@ public class AetherBasedResolver { mirroedRepos.add( naming.get( rep ) ); } mirror.setMirroredRepositories( mirroedRepos ); + m_remoteRepos.removeAll(mirroedRepos); m_remoteRepos.add( 0, mirror ); }
Hide
Achim Nierbeck added a comment -

@David, if you want to apply this patch yourself, just give me your github account name and I'll give you the needed rights to push

Show
Achim Nierbeck added a comment - @David, if you want to apply this patch yourself, just give me your github account name and I'll give you the needed rights to push
Hide
David Jencks added a comment -

@Achim, I'm djencks at github.... it would be great to get commit rights back since the github move! Thanks!

Show
David Jencks added a comment - @Achim, I'm djencks at github.... it would be great to get commit rights back since the github move! Thanks!
Hide
Achim Nierbeck added a comment -

@David, done!
Welcome to the Team

Show
Achim Nierbeck added a comment - @David, done! Welcome to the Team
Hide
Toni Menzel added a comment -

Welcome! Good work David. Keep it coming.

Show
Toni Menzel added a comment - Welcome! Good work David. Keep it coming.
Hide
David Jencks added a comment -

patch applied... will update version shortly

Show
David Jencks added a comment - patch applied... will update version shortly

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: