public static ArtifactRepository toArtifactRepository(String id, String url, String layout,
boolean containsReleases,
boolean containsSnapshots)
{
MavenArtifactRepository result = new MavenArtifactRepository();
result.setId(id);
result.setUrl(url);
if (Strings.isNullOrEmpty(layout) || "default".equals(layout))
{
result.setLayout(new DefaultRepositoryLayout());
}
else if ("flat".equals(layout))
{
result.setLayout(new FlatRepositoryLayout());
}
result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(containsReleases,
ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER,
ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(containsSnapshots,
ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY,
ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
return result;
}