proxy = new Proxy(null, resolutionHelper.getProxyHost(), resolutionHelper.getProxyPort(), auth);
}
if (StringUtils.isNotBlank(snapshotRepoUrl)) {
logger.debug("[buildinfo] Enforcing snapshot repository for resolution: " + snapshotRepoUrl);
RepositoryPolicy releasePolicy = new RepositoryPolicy(false, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN);
RepositoryPolicy snapshotPolicy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN);
RemoteRepository.Builder builder = new RemoteRepository.Builder("artifactory-snapshot", "default", snapshotRepoUrl);
builder.setReleasePolicy(releasePolicy);
builder.setSnapshotPolicy(snapshotPolicy);
if (authentication != null) {
logger.debug("[buildinfo] Enforcing repository authentication: " + authentication + " for snapshot resolution repository");
builder.setAuthentication(authentication);
}
if (proxy != null) {
logger.debug("[buildinfo] Enforcing proxy: " + proxy + " for snapshot resolution repository");
builder.setProxy(proxy);
}
snapshotRepository = builder.build();
}
if (StringUtils.isNotBlank(releaseRepoUrl)) {
logger.debug("[buildinfo] Enforcing release repository for resolution: " + releaseRepoUrl);
boolean snapshotPolicyEnabled = snapshotRepository == null;
String repositoryId = snapshotPolicyEnabled ? "artifactory-release-snapshot" : "artifactory-release";
RepositoryPolicy releasePolicy = new RepositoryPolicy(true, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN);
RepositoryPolicy snapshotPolicy = new RepositoryPolicy(snapshotPolicyEnabled, RepositoryPolicy.UPDATE_POLICY_DAILY, RepositoryPolicy.CHECKSUM_POLICY_WARN);
RemoteRepository.Builder builder = new RemoteRepository.Builder(repositoryId, "default", releaseRepoUrl);
builder.setReleasePolicy(releasePolicy);
builder.setSnapshotPolicy(snapshotPolicy);
if (authentication != null) {
logger.debug("[buildinfo] Enforcing repository authentication: " + authentication + " for release resolution repository");