org.apache.tools.ant.taskdefs.Java.setJar()方法的使用及代码示例

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

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

Java.setJar介绍

[英]Set the location of the JAR file to execute.
[中]设置要执行的JAR文件的位置。

代码示例

代码示例来源:origin: codehaus-cargo/cargo

/**
 * {@inheritDoc}
 */
@Override
public void setJarFile(File jarFile)
{
  if (jarFile != null)
  {
    this.java.setJar(jarFile);
  }
}

代码示例来源:origin: net.wasdev.wlp.ant/wlp-anttasks

protected void installLiberty(File jarFile) throws Exception {
  Java java = (Java) getProject().createTask("java");
  java.setJar(jarFile);
  java.setFork(true);
  java.createArg().setValue("-acceptLicense");
  java.createArg().setValue(baseDir);
  int exitCode = java.executeJava();
  if (exitCode != 0) {
    throw new BuildException("Error installing Liberty.");
  }
}

代码示例来源:origin: net.sf.antenna/antenna

private void executeMPowerEmulator(String device) throws BuildException {
  String arguments = utility.getQuotedName(jadFile);
      
  log("Arguments : " + arguments, Project.MSG_VERBOSE);
  Java java = new Java();
  java.setProject(getProject());
  java.setTaskName(getTaskName());
  java.setFork(true);
  java.setJar(new File(utility.getWtkRelative("player.jar")));
  java.setArgs(arguments);
  java.executeJava();
}

代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin

private void startContainer(final Product product)
{
  final Map<String,String> systemProperties = getSystemProperties(product);
  final Java java = javaTaskFactory.newJavaTask(output(product.getOutput()).systemProperties(systemProperties).
      jvmArgs(product.getJvmArgs() + product.getDebugArgs()));
  java.setDir(getBaseDirectory(product));
  java.setJar(findServerJar(product));
  java.createArg().setValue("--host");
  java.createArg().setValue(product.getServer());
  java.createArg().setValue("--port");
  java.createArg().setValue(Integer.toString(product.getHttpPort()));
  final AntJavaExecutorThread javaThread = new AntJavaExecutorThread(java);
  javaThread.start();
}

代码示例来源:origin: openimaj/openimaj

protected void setup(Java java) {
  if (jarFile != null) {
    java.setJar(jarFile);
  } else {
    if (classPath == null) {
      java.setClasspath(Path.systemClasspath);
    } else {
      java.setClasspath(new Path(java.getProject(), classPath));
    }
    java.setClassname(mainClass);
  }
  if (jvmArgs != null) {
    final Argument jvmArg = java.createJvmarg();
    jvmArg.setLine(jvmArgs);
  }
  if (args != null) {
    final Argument taskArgs = java.createArg();
    taskArgs.setLine(args);
  }
  java.getProject().addBuildListener(new SimpleListener(java, outputOut, outputErr));
  java.setCloneVm(cloneVM);
}

代码示例来源:origin: com.atlassian.maven.plugins/maven-amps-plugin

private void startContainer(final Product product)
{
  final Map<String,String> systemProperties = getSystemProperties(product);
  final Java java = javaTaskFactory.newJavaTask(output(product.getOutput()).systemProperties(systemProperties).
      jvmArgs(product.getJvmArgs() + product.getDebugArgs()));
  java.setDir(getBaseDirectory(product));
  java.setJar(findServerJar(product));
  java.createArg().setValue("--host");
  java.createArg().setValue(product.getServer());
  java.createArg().setValue("--port");
  java.createArg().setValue(Integer.toString(product.getHttpPort()));
  final AntJavaExecutorThread javaThread = new AntJavaExecutorThread(java);
  javaThread.start();
}

相关文章