super.setClassname(useGroovyShell ? "groovy.lang.GroovyShell" : "org.codehaus.groovy.ant.Groovy"); configureCompiler(); super.execute(); } catch (Exception e) { Writer writer = new StringBuilderWriter();
/** * 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(); }
/** * 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); } }
getFindbugsEngine().execute(); } catch (BuildException be) {
/** * 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(); }
execTask.execute();
Project.MSG_VERBOSE); javaTask.execute();
java.execute(); return true; } catch (Exception ex) {
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(); }
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. // } } };
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. // } } };
@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); } }
/** 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(); }
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(); }
public void execute() throws BuildException { super.createArg().setValue(generatorConfig); super.createArg().setValue(facesConfig); super.setClassname(generatorClass); super.execute(); } // END execute
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); } }