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

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

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

Java.execute介绍

[英]Do the execution.
[中]执行死刑。

代码示例

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

super.setClassname(useGroovyShell ? "groovy.lang.GroovyShell" : "org.codehaus.groovy.ant.Groovy");
  configureCompiler();
  super.execute();
} catch (Exception e) {
  Writer writer = new StringBuilderWriter();

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

/**
 *  Perform the actual deployment.
 *  For this generic implementation, a JVM is spawned using the
 *  supplied classpath, classname, JVM args, and command line arguments.
 *  @exception BuildException if the attributes are invalid or incomplete.
 */
@Override
public void deploy() throws BuildException {
  java.setClassname(className);
  java.setClasspath(getClasspath());
  java.setFork(true);
  java.setFailonerror(true);
  java.execute();
}

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

/**
 * Verify the produced jar file by invoking the Borland verify tool
 * @param sourceJar java.io.File representing the produced jar file
 */
private void verifyBorlandJarV4(File sourceJar) {
  Java javaTask = null;
  log("verify BAS " + sourceJar, Project.MSG_INFO);
  try  {
    String args = verifyArgs;
    args += " " + sourceJar.getPath();
    javaTask = new Java(getTask());
    javaTask.setTaskName("verify");
    javaTask.setClassname(VERIFY);
    Commandline.Argument arguments = javaTask.createArg();
    arguments.setLine(args);
    Path classpath = getCombinedClasspath();
    if (classpath != null)  {
      javaTask.setClasspath(classpath);
      javaTask.setFork(true);
    }
    log("Calling " + VERIFY + " for " + sourceJar.toString(),
      Project.MSG_VERBOSE);
    javaTask.execute();
  } catch (Exception e) {
    //TO DO : delete the file if it is not a valid file.
    String msg = "Exception while calling " + VERIFY + " Details: "
      + e.toString();
    throw new BuildException(msg, e);
  }
}

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

getFindbugsEngine().execute();
} catch (BuildException be) {

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

/**
 *  Perform the actual deployment.
 *  For this implementation, a JVM is spawned and the weblogic.deploy
 *  tools is executed.
 *  @exception BuildException if the attributes are invalid or incomplete.
 */
@Override
public void deploy() {
  Java java = new Java(getTask());
  java.setFork(true);
  java.setFailonerror(true);
  java.setClasspath(getClasspath());
  java.setClassname(WEBLOGIC_DEPLOY_CLASS_NAME);
  java.createArg().setLine(getArguments());
  java.execute();
}

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

execTask.execute();

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

Project.MSG_VERBOSE);
javaTask.execute();

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

java.execute();
  return true;
} catch (Exception ex) {

代码示例来源:origin: hcoles/pitest

void execute(final Java java) {
 this.setOption(ConfigOption.INCLUDE_LAUNCH_CLASSPATH, "false");
 this.setOption(ConfigOption.CLASSPATH, generateAnalysisClasspath());
 java.setClasspath(generateLaunchClasspath());
 java.setClassname(MutationCoverageReport.class.getCanonicalName());
 java.setFailonerror(true);
 java.setFork(true);
 checkRequiredOptions();
 for (final Map.Entry<String, String> option : this.options.entrySet()) {
  java.createArg().setValue(
    "--" + option.getKey() + "=" + option.getValue());
 }
 java.execute();
}

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

public void run() {
    try {
      java.execute();
    }
    catch (Exception e) {
      errorHolder.set(e);
      //
      // NOTE: Don't log here, as when the JVM exists an exception will get thrown by Ant
      //       but that should be fine.
      //
    }
  }
};

代码示例来源:origin: org.apache.geronimo.genesis.plugins/plugin-support

public void run() {
    try {
      java.execute();
    }
    catch (Exception e) {
      errorHolder.set(e);
      //
      // NOTE: Don't log here, as when the JVM exists an exception will get thrown by Ant
      //       but that should be fine.
      //
    }
  }
};

代码示例来源:origin: org.eclipse.xtend/org.eclipse.xtend.core

@Override
public void execute() throws BuildException {
  createArgs();
  setClassname(Main.class.getName());
  createArg().setValue(getSrcdir().toString());
  //log(getCommandLine().toString());
  try {
    super.execute();
  } catch (Exception ex) {
    if (ex.getCause() != null) {
      ex.getCause().printStackTrace();
    }
    String message = "Compilation failed: " + String.valueOf(ex.getMessage());
    if (ex.getCause() != null) {
      message += " cause: " + String.valueOf(ex.getCause().getMessage());
    }
    throw new BuildException(message, ex);
  }
}

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

java.execute();

代码示例来源:origin: nekohtml/nekodtd

/** Convert a DTD to its XML representation. */
private void convertFile(File fromFile, File toFile) {
  toFile.getParentFile().mkdirs();
  setClassname("xni.Writer");
  //setLogError(true);
  try {
    Class cls = getClass();
    Method method = cls.getMethod("setLogError", new Class[]{boolean.class});
    method.invoke(this, new Object[]{Boolean.TRUE});
  }
  catch (Exception e) {
    // older version of Ant, so ignore
  }
  createArg().setLine("-p");
  createArg().setLine("org.cyberneko.dtd.DTDConfiguration");
  createArg().setLine(fromFile.getPath());
  setOutput(toFile);
  setFork(true); // if we don't do this, the output stream isn't reset
  super.execute();
  clearArgs();
}

代码示例来源:origin: org.pitest/pitest-ant

void execute(final Java java) {
 this.setOption(ConfigOption.INCLUDE_LAUNCH_CLASSPATH, "false");
 this.setOption(ConfigOption.CLASSPATH, generateAnalysisClasspath());
 java.setClasspath(generateLaunchClasspath());
 java.setClassname(MutationCoverageReport.class.getCanonicalName());
 java.setFailonerror(true);
 java.setFork(true);
 checkRequiredOptions();
 for (final Map.Entry<String, String> option : this.options.entrySet()) {
  java.createArg().setValue(
    "--" + option.getKey() + "=" + option.getValue());
 }
 java.execute();
}

代码示例来源:origin: javaserverfaces/mojarra

public void execute() throws BuildException {
  super.createArg().setValue(generatorConfig);
  super.createArg().setValue(facesConfig);
  super.setClassname(generatorClass);
  super.execute();
} // END execute

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

super.execute();

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

this.java.execute();

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

this.java.execute();

代码示例来源:origin: axis/axis-ant

private void executeInForkedVM(String[] args) {
  try {
    // Create an instance of the compiler, redirecting output to
    // the project log
    Java java = (Java) (getProject().createTask("java"));
    getProject().log("using classpath: " + classpath,
        Project.MSG_DEBUG);
    java.setClasspath(classpath);
    java.setClassname("org.apache.axis.client.AdminClient");
    for (int i = 0; i < args.length; i++) {
      java.createArg().setValue(args[i]);
    }
    java.setFailonerror(failOnError);
    //we are forking here to be sure that if AdminClient calls
    //System.exit() it doesn't halt the build
    java.setFork(true);
    java.setTaskName("AdminClient");
    java.execute();
  } catch (BuildException e) {
    //rethrow these
    throw e;
  } catch (Exception e) {
    throw new BuildException("Exception in " + getTaskName(), e);
  }
}

相关文章