use of org.apache.maven.artifact.repository.MavenArtifactRepository in project maven-archetype by apache.
the class DefaultArchetypeGenerationConfigurator method createRepository.
private ArtifactRepository createRepository(String url, String repositoryId) {
// snapshots vs releases
// offline = to turning the update policy off
// TODO: we'll need to allow finer grained creation of repositories but this will do for now
String updatePolicyFlag = ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS;
String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
ArtifactRepositoryPolicy snapshotsPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
return new MavenArtifactRepository(repositoryId, url, defaultArtifactRepositoryLayout, snapshotsPolicy, releasesPolicy);
}
use of org.apache.maven.artifact.repository.MavenArtifactRepository in project maven-archetype by apache.
the class RemoteCatalogArchetypeDataSourceTest method testRemoteCatalog.
public void testRemoteCatalog() throws Exception {
ArchetypeManager archetype = lookup(ArchetypeManager.class);
LegacySupport legacySupport = lookup(LegacySupport.class);
legacySupport.setSession(newMavenSession(new MavenProjectStub()));
ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
buildingRequest.getRemoteRepositories().add(new MavenArtifactRepository("central", "http://localhost:" + port + "/repo/", new DefaultRepositoryLayout(), null, null));
ArchetypeCatalog result = archetype.getRemoteCatalog(buildingRequest);
assertEquals(1, result.getArchetypes().size());
assertEquals("groupId", result.getArchetypes().get(0).getGroupId());
assertEquals("artifactId", result.getArchetypes().get(0).getArtifactId());
assertEquals("1", result.getArchetypes().get(0).getVersion());
assertEquals("http://localhost:" + port + "/repo/", result.getArchetypes().get(0).getRepository());
}
use of org.apache.maven.artifact.repository.MavenArtifactRepository in project maven-archetype by apache.
the class ArchetyperRoundtripIT method createRepository.
private ArtifactRepository createRepository(String url, String repositoryId) {
String updatePolicyFlag = ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS;
String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
ArtifactRepositoryPolicy snapshotsPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
return new MavenArtifactRepository(repositoryId, url, new DefaultRepositoryLayout(), snapshotsPolicy, releasesPolicy);
}
use of org.apache.maven.artifact.repository.MavenArtifactRepository in project maven-archetype by apache.
the class DefaultArchetypeGenerator method createRepository.
private ArtifactRepository createRepository(String url, String repositoryId) {
// snapshots vs releases
// offline = to turning the update policy off
// TODO: we'll need to allow finer grained creation of repositories but this will do for now
String updatePolicyFlag = ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS;
String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
ArtifactRepositoryPolicy snapshotsPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
return new MavenArtifactRepository(repositoryId, url, defaultArtifactRepositoryLayout, snapshotsPolicy, releasesPolicy);
}
use of org.apache.maven.artifact.repository.MavenArtifactRepository in project maven-archetype by apache.
the class ArchetypeGenerationTest method createRepository.
private ArtifactRepository createRepository(String url, String repositoryId) {
String updatePolicyFlag = ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS;
String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
ArtifactRepositoryPolicy snapshotsPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy(true, updatePolicyFlag, checksumPolicyFlag);
return new MavenArtifactRepository(repositoryId, url, new DefaultRepositoryLayout(), snapshotsPolicy, releasesPolicy);
}
Aggregations