cmd.setExecutable(JavaEnvUtils.getJdkExecutable("keytool")); Commandline.Argument arg = cmd.createArg(); arg.setLine(sb.toString()); cmd.setFailonerror(true); cmd.setTaskName(getTaskName());
exec.createArg().setLine(cmdOptions);
findbugsEngine.createJvmarg().setLine(jvmargs);
public JavaTaskBuilder withProperties(Map<String, String> properties) { if (properties != null) { for (Object key : properties.keySet()) { // javaTask.createArg() would append the parameter at the beginning before the classname // but it must be appended at the end. Commandline.Argument newArg = javaTask.getCommandLine().getJavaCommand().createArgument(false); newArg.setLine("-p " + key + "=" + properties.get(key)); } } return this; }
/** * Set dumpddl to a file * @param ddlFileName Name of DDL file */ public void setDumpDdl(String ddlFileName) { if (ddlFileName != null && ddlFileName.length() > 0) { createArg().setLine("-dumpDdl " + ddlFileName); log("JPOX SchemaTool dumpDdl: " + ddlFileName, Project.MSG_VERBOSE); } }
javaTask.setTaskName("ejbc"); javaTask.createJvmarg().setLine(additionalJvmArgs); sysprops.forEach(javaTask::addSysproperty); javaTask.createJvmarg().setLine(" -Dweblogic.StdoutSeverityLevel=" + jvmDebugLevel); javaTask.createArg().setLine(additionalArgs); if (keepgenerated) { javaTask.createArg().setValue("-keepgenerated"); javaTask.createArg().setLine(compiler);
toExecute.createArgument().setLine(command);
java.createArg().setLine("-n " + getServer()); || ACTION_UPDATE.equals(action) || "redeploy".equals(action)) { java.createArg().setLine("-a " + getTask().getSource()); } else if (action.equals(ACTION_DELETE) || action.equals(ACTION_UNDEPLOY)) { java.createArg().setLine("-r " + getTask().getSource()); } else if (action.equals(ACTION_LIST)) { java.createArg().setValue("-l");
jvmargs = jvmargs + " -Dfindbugs.debug=true"; findbugsEngine.createJvmarg().setLine(jvmargs);
javaTask.createArg().setValue(tempdir); javaTask.createArg().setValue(destJar.getPath()); javaTask.createArg().setLine(getOptions()); if (getCombinedClasspath() != null && !getCombinedClasspath().toString().isEmpty()) {
commandline.createArgument().setLine(java2iioparams);
/** * do the work * @throws BuildException if failonerror is set to true and the * cvs command fails. */ @Override public void execute() throws BuildException { String savedCommand = getCommand(); if (this.getCommand() == null && commandlines.isEmpty()) { // re-implement legacy behaviour: this.setCommand(AbstractCvsTask.DEFAULT_COMMAND); } String c = this.getCommand(); Commandline cloned = null; if (c != null) { cloned = (Commandline) cmd.clone(); cloned.createArgument(true).setLine(c); this.addConfiguredCommandline(cloned, true); } try { commandlines.forEach(this::runCommand); } finally { if (cloned != null) { removeCommandline(cloned); } setCommand(savedCommand); FileUtils.close(outputStream); FileUtils.close(errorStream); } }
/** * 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); } }
/** * 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(); }
/** * Execute the given command, and return it's output * @param cmdline command line to execute * @return output of the command line */ protected String runS(Commandline cmdline) { String outV = "opts.cc.runS.output" + pcnt++; ExecTask exe = new ExecTask(this); Commandline.Argument arg = exe.createArg(); exe.setExecutable(cmdline.getExecutable()); arg.setLine(Commandline.toString(cmdline.getArguments())); exe.setOutputproperty(outV); exe.execute(); return getProject().getProperty(outV); }
/** * Deprecated: use nested arg instead. * Set the command line arguments for the class. * * @param s arguments. * * @ant.attribute ignore="true" */ public void setArgs(String s) { log("The args attribute is deprecated. Please use nested arg elements.", Project.MSG_WARN); getCommandLine().createArgument().setLine(s); }
/** * Set an additional parameter on the command line * * @param add the additional command line parameter for the javadoc task. */ public void setAdditionalparam(final String add) { cmd.createArgument().setLine(add); }
/** * Set the command line arguments for the JVM. * * @param s jvmargs. */ public void setJvmargs(String s) { log("The jvmargs attribute is deprecated. Please use nested jvmarg elements.", Project.MSG_WARN); getCommandLine().createVmArgument().setLine(s); }