jenkins.model.Jenkins.getJnlpJars()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(134)

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

Jenkins.getJnlpJars介绍

[英]Serves jar files for JNLP agents.
[中]为JNLP代理提供jar文件。

代码示例

代码示例来源:origin: jenkinsci/jenkins-test-harness

/**
 * Creates a launcher for starting a local agent.
 *
 * @param env
 *      Environment variables to add to the slave process. Can be null.
 */
public ComputerLauncher createComputerLauncher(EnvVars env) throws URISyntaxException, IOException {
  int sz = jenkins.getNodes().size();
  return new SimpleCommandLauncher(
      String.format("\"%s/bin/java\" %s %s -jar \"%s\"",
          System.getProperty("java.home"),
          SLAVE_DEBUG_PORT>0 ? " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address="+(SLAVE_DEBUG_PORT+sz): "",
          "-Djava.awt.headless=true",
          new File(jenkins.getJnlpJars("slave.jar").getURL().toURI()).getAbsolutePath()),
      env);
}

代码示例来源:origin: jenkinsci/jenkins-test-harness

/**
 * Creates a {@link ComputerLauncher} for launching a slave locally.
 *
 * @param env
 *      Environment variables to add to the slave process. Can be null.
 */
public ComputerLauncher createComputerLauncher(EnvVars env) throws URISyntaxException, IOException {
  int sz = jenkins.getNodes().size();
  return new SimpleCommandLauncher(
      String.format("\"%s/bin/java\" %s %s -jar \"%s\"",
          System.getProperty("java.home"),
          SLAVE_DEBUG_PORT>0 ? " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address="+(SLAVE_DEBUG_PORT+sz): "",
          "-Djava.awt.headless=true",
          new File(jenkins.getJnlpJars("slave.jar").getURL().toURI()).getAbsolutePath()),
      env);
}

代码示例来源:origin: jenkinsci/gerrit-trigger-plugin

/**
 * Constructs the java command for launching a jenkins-cli command.
 *
 * @param cmd the cli command to run with parameters.
 * @return the full command <code>java -jar path/to/jenkins-cli.jar -s theurl cmd...</code>.
 * @throws IOException        if so
 * @throws URISyntaxException if so
 */
List<String> javaCliJarCmd(String... cmd) throws IOException, URISyntaxException {
  List<String> commands = new ArrayList<String>(cmd.length + 5);
  commands.add(String.format("%s/bin/java", System.getProperty("java.home")));
  commands.add("-jar");
  commands.add(new File(j.jenkins.getJnlpJars("jenkins-cli.jar").getURL().toURI()).getAbsolutePath());
  commands.add("-s");
  commands.add(j.getURL().toExternalForm());
  Collections.addAll(commands, cmd);
  return commands;
}

代码示例来源:origin: jenkinsci/ec2-plugin

slaveJar.write(Jenkins.getInstance().getJnlpJars(SLAVE_JAR).readFully());

代码示例来源:origin: jenkinsci/azure-vm-agents-plugin

InputStream inputStream = new ByteArrayInputStream(Jenkins.getInstance().getJnlpJars("slave.jar").
    readFully());
copyFileToRemote(session, inputStream, "slave.jar");

代码示例来源:origin: jenkinsci/ec2-plugin

scp.put(Jenkins.getInstance().getJnlpJars("slave.jar").readFully(), "slave.jar", tmpDir);

相关文章

Jenkins类方法