本文整理汇总了Java中org.apache.maven.artifact.repository.MavenArtifactRepository.setId方法的典型用法代码示例。如果您正苦于以下问题:Java MavenArtifactRepository.setId方法的具体用法?Java MavenArtifactRepository.setId怎么用?Java MavenArtifactRepository.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.artifact.repository.MavenArtifactRepository
的用法示例。
在下文中一共展示了MavenArtifactRepository.setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertFromMavenSettingsRepository
import org.apache.maven.artifact.repository.MavenArtifactRepository; //导入方法依赖的package包/类
public static ArtifactRepository convertFromMavenSettingsRepository(Repository repository)
{
MavenArtifactRepository result = new MavenArtifactRepository();
result.setId(repository.getId());
result.setUrl(repository.getUrl());
String layout = repository.getLayout();
if ("default".equals(layout))
result.setLayout(new DefaultRepositoryLayout());
else if ("p2".equals(layout))
result.setLayout(new P2ArtifactRepositoryLayout());
RepositoryPolicy releases = repository.getReleases();
if (releases != null)
result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
releases.getChecksumPolicy()));
RepositoryPolicy snapshots = repository.getSnapshots();
if (snapshots != null)
result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
snapshots.getUpdatePolicy(),
snapshots.getChecksumPolicy()));
return result;
}
示例2: toArtifactRepository
import org.apache.maven.artifact.repository.MavenArtifactRepository; //导入方法依赖的package包/类
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 (layout == null || layout.isEmpty() || "default".equals(layout))
{
result.setLayout(new DefaultRepositoryLayout());
}
else if ("p2".equals(layout))
{
result.setLayout(new P2ArtifactRepositoryLayout());
}
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;
}
示例3: repo
import org.apache.maven.artifact.repository.MavenArtifactRepository; //导入方法依赖的package包/类
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;
}