Java Code Examples for org.apache.maven.artifact.repository.ArtifactRepositoryPolicy#setEnabled()
The following examples show how to use
org.apache.maven.artifact.repository.ArtifactRepositoryPolicy#setEnabled() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DependencyResolver.java From spring-init with Apache License 2.0 | 5 votes |
private ArtifactRepository repo(String id, String url, boolean releases, boolean snapshots) { MavenArtifactRepository repository = new MavenArtifactRepository(); repository.setLayout(new DefaultRepositoryLayout()); repository.setId(id); repository.setUrl(url); ArtifactRepositoryPolicy enabled = new ArtifactRepositoryPolicy(); enabled.setEnabled(true); ArtifactRepositoryPolicy disabled = new ArtifactRepositoryPolicy(); disabled.setEnabled(false); repository.setReleaseUpdatePolicy(releases ? enabled : disabled); repository.setSnapshotUpdatePolicy(snapshots ? enabled : disabled); return repository; }
Example 2
Source File: DependencyResolver.java From spring-cloud-function with Apache License 2.0 | 5 votes |
private ArtifactRepository repo(String id, String url, boolean releases, boolean snapshots) { MavenArtifactRepository repository = new MavenArtifactRepository(); repository.setLayout(new DefaultRepositoryLayout()); repository.setId(id); repository.setUrl(url); ArtifactRepositoryPolicy enabled = new ArtifactRepositoryPolicy(); enabled.setEnabled(true); ArtifactRepositoryPolicy disabled = new ArtifactRepositoryPolicy(); disabled.setEnabled(false); repository.setReleaseUpdatePolicy(releases ? enabled : disabled); repository.setSnapshotUpdatePolicy(snapshots ? enabled : disabled); return repository; }