Skip to content

Commit

Permalink
Merge pull request #46 from jfdenise/main
Browse files Browse the repository at this point in the history
Ignore SNAPSHOTS in remote repositories
  • Loading branch information
jfdenise authored Feb 8, 2024
2 parents 4049924 + 961fb70 commit 9c9a974
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.aether.repository.RepositoryPolicy;

/**
*
Expand All @@ -56,12 +57,20 @@ public static MavenRepoManager newMavenResolver() {
session.setLocalRepositoryManager(repoSystem.newLocalRepositoryManager(session, localRepo));
List<RemoteRepository> repos = new ArrayList<>();
RemoteRepository.Builder central = new RemoteRepository.Builder("central", "default", CENTRAL_REPO_URL);
central.setSnapshotPolicy(new RepositoryPolicy(false, RepositoryPolicy.UPDATE_POLICY_NEVER,
RepositoryPolicy.CHECKSUM_POLICY_IGNORE));
repos.add(central.build());
RemoteRepository.Builder ga = new RemoteRepository.Builder("redhat-ga", "default", GA_REPO_URL);
ga.setSnapshotPolicy(new RepositoryPolicy(false, RepositoryPolicy.UPDATE_POLICY_NEVER,
RepositoryPolicy.CHECKSUM_POLICY_IGNORE));
repos.add(ga.build());
RemoteRepository.Builder nexus = new RemoteRepository.Builder("jboss-nexus", "default", JBOSS_REPO_URL);
nexus.setSnapshotPolicy(new RepositoryPolicy(false, RepositoryPolicy.UPDATE_POLICY_NEVER,
RepositoryPolicy.CHECKSUM_POLICY_IGNORE));
repos.add(nexus.build());
RemoteRepository.Builder spring = new RemoteRepository.Builder("spring-repo", "default", SPRING_REPO_URL);
spring.setSnapshotPolicy(new RepositoryPolicy(false, RepositoryPolicy.UPDATE_POLICY_NEVER,
RepositoryPolicy.CHECKSUM_POLICY_IGNORE));
repos.add(spring.build());
MavenArtifactRepositoryManager resolver
= new MavenArtifactRepositoryManager(repoSystem, session, repos);
Expand Down

0 comments on commit 9c9a974

Please sign in to comment.