org.apache.maven.settings.Mirror.setId()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.apache.maven.settings.Mirror.setId()方法的一些代码示例,展示了Mirror.setId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mirror.setId()方法的具体详情如下:
包路径:org.apache.maven.settings.Mirror
类名称:Mirror
方法名:setId

Mirror.setId介绍

暂无

代码示例

代码示例来源:origin: apache/maven

private Mirror getMirror( RepositorySystemSession session, ArtifactRepository repository )
{
  if ( session != null )
  {
    org.eclipse.aether.repository.MirrorSelector selector = session.getMirrorSelector();
    if ( selector != null )
    {
      RemoteRepository repo = selector.getMirror( RepositoryUtils.toRepo( repository ) );
      if ( repo != null )
      {
        Mirror mirror = new Mirror();
        mirror.setId( repo.getId() );
        mirror.setUrl( repo.getUrl() );
        mirror.setLayout( repo.getContentType() );
        return mirror;
      }
    }
  }
  return null;
}

代码示例来源:origin: apache/maven

private Mirror getMirror( RepositorySystemSession session, ArtifactRepository repository )
{
  if ( session != null )
  {
    org.eclipse.aether.repository.MirrorSelector selector = session.getMirrorSelector();
    if ( selector != null )
    {
      RemoteRepository repo = selector.getMirror( RepositoryUtils.toRepo( repository ) );
      if ( repo != null )
      {
        Mirror mirror = new Mirror();
        mirror.setId( repo.getId() );
        mirror.setUrl( repo.getUrl() );
        mirror.setLayout( repo.getContentType() );
        return mirror;
      }
    }
  }
  return null;
}

代码示例来源:origin: apache/maven

mirror.setId( interpolatedTrimmed( parser.nextText(), "id" ) );

代码示例来源:origin: ru.yandex.qatools.clay/clay-maven-settings-builder

/**
 * Set the id field.
 * @param id
 */
public FluentMirrorBuilder withId(String id) {
  mirror.setId(id);
  return this;
}

代码示例来源:origin: org.apache.maven/maven-settings

mirror.setId( interpolatedTrimmed( parser.nextText(), "id" ) );

代码示例来源:origin: org.eclipse.tycho/tycho-core

private Mirror createMirror(ArtifactRepository repo, Mirror toMirror) {
  Mirror mirror = toMirror.clone();
  String urlToReplace = toMirror.getMirrorOf();
  String newUrl = StringUtils.replaceOnce(repo.getUrl(), urlToReplace, toMirror.getUrl());
  mirror.setUrl(newUrl);
  mirror.setId(toMirror.getId());
  return mirror;
}

相关文章