org.apache.maven.wagon.repository.Repository.getId()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(106)

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

Repository.getId介绍

暂无

代码示例

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

public String getName()
{
  if ( name == null )
  {
    return getId();
  }
  return name;
}

代码示例来源:origin: org.apache.maven.wagon/wagon-provider-api

public String getName()
{
  if ( name == null )
  {
    return getId();
  }
  return name;
}

代码示例来源:origin: io.packagecloud.maven.wagon/maven-packagecloud-wagon

private void raiseAndtroubleShootPassword() throws AuthorizationException {
  StringBuffer buf = new StringBuffer();
  buf.append("\n\n\n-----AUTHENTICATION ERROR-----\n");
  buf.append("Cannot find password for repository id:");
  buf.append(getRepository().getId());
  buf.append(" in settings.xml!\n");
  buf.append("-----AUTHENTICATION ERROR-----\n\n\n");
  throw new AuthorizationException(buf.toString());
}

代码示例来源:origin: org.apache.maven.plugins/maven-site-plugin

/**
 * Use wagon to deploy the generated site to a given repository.
 *
 * @param repository the repository to deploy to.
 *                   This needs to contain a valid, non-null {@link Repository#getId() id}
 *                   to look up credentials for the deploy, and a valid, non-null
 *                   {@link Repository#getUrl() scm url} to deploy to.
 * @throws MojoExecutionException if the deploy fails.
 */
private void deployTo( final Repository repository )
  throws MojoExecutionException
{
  if ( !inputDirectory.exists() )
  {
    throw new MojoExecutionException( "The site does not exist, please run site:site first" );
  }
  if ( getLog().isDebugEnabled() )
  {
    getLog().debug( "Deploying to '" + repository.getUrl() + "',\n    Using credentials from server id '"
              + repository.getId() + "'" );
  }
  deploy( inputDirectory, repository );
}

代码示例来源:origin: org.apache.continuum/continuum-artifact-manager

public Wagon getWagon( Repository repository )
  throws UnsupportedProtocolException, WagonConfigurationException
{
  String protocol = repository.getProtocol();
  if ( protocol == null )
  {
    throw new UnsupportedProtocolException( "The repository " + repository + " does not specify a protocol" );
  }
  Wagon wagon = getWagon( protocol, repository.getId() );
  return wagon;
}

代码示例来源:origin: stackoverflow.com

Map<String, Repository> map = new LinkedHashMap<String, Repository>(adaptedEntries.size());
for (Repository repository : adaptedEntries) {
  System.out.println("Reading repository " + repository.getId());
  map.put(repository.getId(), repository);

代码示例来源:origin: stackoverflow.com

= new RemoteRepository(repo.getId(), "default", repo.getUrl());
remotes.add(remoteRepo);

代码示例来源:origin: opoo/opoopress

final String relativeDir,
           final Log log) throws MojoExecutionException {
AuthenticationInfo authenticationInfo = manager.getAuthenticationInfo(repository.getId());
log.debug("authenticationInfo with id '" + repository.getId() + "': "
    + ((authenticationInfo == null) ? "-" : authenticationInfo.getUserName()));

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

public void transferStarted( TransferEvent event )
  {
    long contentLength = event.getResource().getContentLength();
    if ( contentLength > 0 )
    {
      log( "Transferring " + ( ( contentLength + KILO / 2 ) / KILO ) + "K from "
              + event.getWagon().getRepository().getId() );
    }
  }
}

代码示例来源:origin: org.apache.maven.plugins/maven-site-plugin

throws MojoExecutionException
AuthenticationInfo authenticationInfo = wagonManager.getAuthenticationInfo( repository.getId() );
getLog().debug( "authenticationInfo with id '" + repository.getId() + "': "
          + ( ( authenticationInfo == null ) ? "-" : authenticationInfo.getUserName() ) );

代码示例来源:origin: opoo/opoopress

private void deploy(SiteImpl site, File directory, Repository repository) throws MojoExecutionException, MojoFailureException {
  // TODO: work on moving this into the deployer like the other deploy
  // methods
  final Wagon wagon = getWagon(repository, wagonManager);
  try {
    configureWagon(wagon, repository.getId(), settings, container, getLog());
  } catch (WagonConfigurationException e) {
    throw new MojoExecutionException("Unable to configure Wagon: '" + repository.getProtocol() + "'", e);
  }
  String relativeDir = site.getRoot();
  if ("".equals(relativeDir)) {
    relativeDir = "./";
  } else if (relativeDir.startsWith("/")) {
    relativeDir = relativeDir.substring(1);
  }
  try {
    final ProxyInfo proxyInfo = getProxyInfo(repository, wagonManager);
    push(directory, repository, wagonManager, wagon, proxyInfo, relativeDir, getLog());
    if (chmod) {
      chmod(wagon, repository, chmodOptions, chmodMode);
    }
  } finally {
    try {
      wagon.disconnect();
    } catch (ConnectionException e) {
      getLog().error("Error disconnecting wagon - ignored", e);
    }
  }
}

代码示例来源:origin: org.codehaus.mojo/versions-maven-plugin

if ( proxyInfo != null )
  wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ), proxyInfo );
  wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ) );

代码示例来源:origin: mojohaus/versions-maven-plugin

if ( proxyInfo != null )
  wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ), proxyInfo );
  wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ) );

代码示例来源:origin: org.nuiton/helper-maven-plugin

protected Wagon getWagon(Repository repository) throws Exception {
  Wagon wagon = wagonManager.getWagon(repository);
  wagon.setTimeout(1000);
  if (getLog().isDebugEnabled()) {
    Debug debug = new Debug();
    wagon.addSessionListener(debug);
    wagon.addTransferListener(debug);
  }
  // FIXME when upgrading to maven 3.x : this must be changed.
  AuthenticationInfo auth = wagonManager.getAuthenticationInfo(repository.getId());
  ProxyInfo proxyInfo = getProxyInfo();
  if (proxyInfo != null) {
    wagon.connect(repository, auth, proxyInfo);
  } else {
    wagon.connect(repository, auth);
  }
  return wagon;
}

代码示例来源:origin: org.apache.maven.plugins/maven-site-plugin

configureWagon( wagon, repository.getId(), settings, container, getLog() );

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

public void transferInitiated( TransferEvent event )
{
  String message = event.getRequestType() == TransferEvent.REQUEST_PUT ? "Uploading" : "Downloading";
  String dest = event.getRequestType() == TransferEvent.REQUEST_PUT ? " to " : " from ";
  log( message + ": " + event.getResource().getName() + dest + "repository "
    + event.getWagon().getRepository().getId() + " at " + event.getWagon().getRepository().getUrl() );
}

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

private ArchetypeCatalog downloadCatalog( ArtifactRepository repository )
  throws WagonException, IOException, ArchetypeDataSourceException
{
  getLogger().debug( "Searching for remote catalog: " + repository.getUrl() + "/" + ARCHETYPE_CATALOG_FILENAME );
  // We use wagon to take advantage of a Proxy that has already been setup in a Maven environment.
  Repository wagonRepository = new Repository( repository.getId(), repository.getUrl() );
  
  AuthenticationInfo authInfo = getAuthenticationInfo( wagonRepository.getId() );
  ProxyInfo proxyInfo = getProxy( wagonRepository.getProtocol() );
  Wagon wagon = getWagon( wagonRepository );
  File catalog = File.createTempFile( "archetype-catalog", ".xml" );
  try
  {
    wagon.connect( wagonRepository, authInfo, proxyInfo );
    wagon.get( ARCHETYPE_CATALOG_FILENAME, catalog );
    return readCatalog( ReaderFactory.newXmlReader( catalog ) );
  }
  finally
  {
    disconnectWagon( wagon );
    catalog.delete();
  }
}

代码示例来源:origin: io.packagecloud.maven.wagon/maven-packagecloud-wagon

insertSystemPropertyToBuf(buf, "java.vm.version");
insertSystemPropertyToBuf(buf, "user.home");
insertKeyValueToBuf(buf, "repository id", getRepository().getId());
insertKeyValueToBuf(buf, "repository url", getRepository().getUrl());

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

throw new AuthenticationException( "Username not specified for repository " + getRepository().getId() );
throw new AuthenticationException( "Password not specified for repository " + getRepository().getId() );

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

throw new AuthenticationException( "Username not specified for repository " + getRepository().getId() );
throw new AuthenticationException( "Password not specified for repository " + getRepository().getId() );

相关文章