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

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

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

Mirror.getName介绍

[英]Get the optional name that describes the mirror.
[中]获取描述镜像的可选名称。

代码示例

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

if ( mirror.getName() != null )
  serializer.startTag( NAMESPACE, "name" ).text( mirror.getName() ).endTag( NAMESPACE, "name" );

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

if ( mirror.getName() != null )
  serializer.startTag( NAMESPACE, "name" ).text( mirror.getName() ).endTag( NAMESPACE, "name" );

代码示例来源:origin: io.fabric8/fabric-maven

private MirrorSelector selectMirrors( Mirror mirror ) {
  // configure mirror
  DefaultMirrorSelector selector = new DefaultMirrorSelector();
  for( Mirror m : m_settings.getMirrors() ) {
    selector.add( m.getName(), m.getUrl(), null, false, m.getMirrorOf(), "*" );
  }
  if( mirror != null ) {
    selector.add(mirror.getName(), mirror.getUrl(), null, false, mirror.getMirrorOf(), "*");
  }
  return selector;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-maven-indexer

/**
 * if the repository has a mirror, then create a repositoryinfo object for it..
 */

private RepositoryInfo getMirrorInfo(RepositoryInfo info, MirrorSelector selector, Settings settings) {
  RemoteRepository original = new RemoteRepository(info.getId(), /* XXX do we even support any other layout?*/"default", info.getRepositoryUrl());
  RemoteRepository mirror = selector.getMirror(original);
  if (mirror != null) {
    try {
      String name = mirror.getId();
      //#213078 need to lookup name for mirror
      for (Mirror m : settings.getMirrors()) {
        if (m.getId() != null && m.getId().equals(mirror.getId())) {
          name = m.getName();
          break;
        }
      }
      RepositoryInfo toret = new RepositoryInfo(mirror.getId(), name, null, mirror.getUrl());
      toret.setMirrorStrategy(RepositoryInfo.MirrorStrategy.NONE);
      return toret;
    } catch (URISyntaxException ex) {
      Exceptions.printStackTrace(ex);
    }
  }
  return null;
}

代码示例来源:origin: org.codehaus.mevenide/nb-mvn-embedder

/**
 * Method updateMirror
 * 
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateMirror(Mirror value, String xmlTag, Counter counter, Element element)
{
  Element root = element;
  Counter innerCount = new Counter(counter.getDepth() + 1);
  findAndReplaceSimpleElement(innerCount, root,  "mirrorOf", value.getMirrorOf(), null);
  findAndReplaceSimpleElement(innerCount, root,  "name", value.getName(), null);
  findAndReplaceSimpleElement(innerCount, root,  "url", value.getUrl(), null);
  findAndReplaceSimpleElement(innerCount, root,  "id", value.getId(), null);
} //-- void updateMirror(Mirror, String, Counter, Element)

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-maven-embedder

/**
 * Method updateMirror.
 * 
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateMirror(Mirror value, String xmlTag, Counter counter, Element element)
{
  Element root = element;
  Counter innerCount = new Counter(counter.getDepth() + 1);
  findAndReplaceSimpleElement(innerCount, root,  "mirrorOf", value.getMirrorOf(), null);
  findAndReplaceSimpleElement(innerCount, root,  "name", value.getName(), null);
  findAndReplaceSimpleElement(innerCount, root,  "url", value.getUrl(), null);
  findAndReplaceSimpleElement(innerCount, root,  "id", value.getId(), null);
} //-- void updateMirror(Mirror, String, Counter, Element)

相关文章