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

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

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

Mirror.setUrl介绍

[英]Set the URL of the mirror repository.
[中]设置镜像存储库的URL。

代码示例

代码示例来源: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.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );

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

/**
 * Set the URL of the mirror repository.
 * @param url
 */
public FluentMirrorBuilder withUrl(String url) {
  mirror.setUrl(url);
  return this;
}

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

mirror.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );

代码示例来源: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;
}

相关文章