当前位置: 首页>>代码示例>>Java>>正文


Java MavenArtifactRepository.setId方法代码示例

本文整理汇总了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;
}
 
开发者ID:forge,项目名称:furnace,代码行数:26,代码来源:RepositoryUtils.java

示例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;

}
 
开发者ID:forge,项目名称:furnace,代码行数:26,代码来源:RepositoryUtils.java

示例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;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-function,代码行数:15,代码来源:DependencyResolver.java


注:本文中的org.apache.maven.artifact.repository.MavenArtifactRepository.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。