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

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

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

Server.setId介绍

暂无

代码示例

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

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

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

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

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

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

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

/**
 * Stores credential information in settings, without persisting them
 * @param force
 * @param id
 * @param username
 * @param password
 * @param prefix
 * @param config
 */
protected boolean updateCredentials(boolean force, String id, String username, String password,
                 String prefix, Dictionary<String, Object> config) throws IOException {
  if (!force && !confirm("Maven settings will be updated and org.ops4j.pax.url.mvn.settings property will change. Continue? (y/N) ")) {
    return false;
  }
  Optional<Server> existingServer = mavenSettings.getServers().stream()
      .filter((s) -> id.equals(s.getId())).findAny();
  Server server = null;
  if (existingServer.isPresent()) {
    server = existingServer.get();
  } else {
    server = new Server();
    server.setId(id);
    mavenSettings.getServers().add(server);
  }
  server.setUsername(username);
  server.setPassword(password);
  return true;
}

代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin

wizard.showMessage("No Bintray server configuration found, you have to provide Bintray credentials to proceed");
bintray = new Server();
bintray.setId(BINTRAY_SERVER_ID);
String bintrayUser = wizard.promptForValueIfMissing(this.bintrayUsername, "your Bintray username");
String bintrayApiKey = wizard.promptForPasswordIfMissing(this.bintrayApiKey, "your Bintray API key");

相关文章