public static Mirror getMirror(ArtifactRepository repository, List<Mirror> mirrors) { String repoId = repository.getId(); if (repoId != null && mirrors != null) { for (Mirror mirror : mirrors) { if (repoId.equals(mirror.getMirrorOf()) && matchesLayout(repository, mirror)) { return mirror; } } for (Mirror mirror : mirrors) { if (matchPattern(repository, mirror.getMirrorOf()) && matchesLayout(repository, mirror)) { return mirror; } } } return null; }
private MirrorSelector getMirrorSelector(Settings settings) { DefaultMirrorSelector selector = new DefaultMirrorSelector(); for (Mirror mirror : settings.getMirrors()) { selector.add( String.valueOf(mirror.getId()), mirror.getUrl(), mirror.getLayout(), false, mirror.getMirrorOf(), mirror.getMirrorOfLayouts()); } return selector; }
/** * Gets mirror selector * * @return the selector */ public MirrorSelector mirrorSelector() { DefaultMirrorSelector dms = new DefaultMirrorSelector(); // fill in mirrors for (Mirror mirror : settings.getMirrors()) { // Repository manager flag is set to false // Maven does not support specifying it in the settings.xml dms.add( mirror.getId(), mirror.getUrl(), mirror.getLayout(), false, mirror.getMirrorOf(), mirror.getMirrorOfLayouts()); } return dms; }
private MirrorSelector getMirrorSelector() { DefaultMirrorSelector selector = new DefaultMirrorSelector(); for (Mirror mirror : mirrors) { selector.add( mirror.getId(), mirror.getUrl(), mirror.getType(), false, mirror.getMirrorOf(), null); } Settings settings = getSettings(); for (org.apache.maven.settings.Mirror mirror : settings.getMirrors()) { selector.add( String.valueOf(mirror.getId()), mirror.getUrl(), mirror.getLayout(), false, mirror.getMirrorOf(), mirror.getMirrorOfLayouts()); } return selector; }