private void injectMirror(ArtifactRepository repository, Mirror mirror) { if (mirror != null) { ArtifactRepository original = createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(), repository.getSnapshots(), repository.getReleases()); repository.setMirroredRepositories(Collections.singletonList(original)); repository.setId(mirror.getId()); repository.setUrl(mirror.getUrl()); if (StringUtils.isNotEmpty(mirror.getLayout())) { repository.setLayout(getLayout(mirror.getLayout())); } } }
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; }