/** * create the command line for updating the current branch with the info from the foreign repository. */ public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory, ScmVersion scmVersion ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "pull" ); cl.createArg().setLine( repository.getFetchUrl() ); // now set the branch where we would like to pull from if ( scmVersion instanceof ScmBranch ) { cl.createArg().setLine( scmVersion.getName() ); } return cl; }
/** * create the command line for updating the current branch with the info from the foreign repository. */ public static Commandline createCommandLine( GitScmProviderRepository repository, File workingDirectory, ScmVersion scmVersion ) { Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "pull" ); cl.createArg().setLine( repository.getFetchUrl() ); // now set the branch where we would like to pull from if ( scmVersion instanceof ScmBranch ) { cl.createArg().setLine( scmVersion.getName() ); } return cl; }
cli.createArg().setLine( baseCommand[i] ); cli.createArg().setLine( "-Dbasedir=\'" + basedir.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-D" + PlexusAppBooterService.DEFAULT_NAME + PlexusAppBooterService.ENABLE_CONTROL_SOCKET + "=" + Boolean.TRUE.toString() ); cli.createArg().setLine( "-Dclassworlds.conf=\'" + classworldsConf.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-Dplexus.container.properties.file='" + containerProperties.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-cp" ); cli.createArg().setLine( "\'" + classworldsJar.getAbsolutePath() + "\'" ); cli.createArg().setLine( "org.codehaus.plexus.classworlds.launcher.Launcher" ); classworldsConf = writeConfig( config ); cli.createArg().setLine( "-Dclassworlds.conf=\'" + classworldsConf.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-jar" ); cli.createArg().setLine( "\'" + platformFile.getAbsolutePath() + "\'" ); cli.createArg().setLine( Integer.toString( controlPort ) );
cli.createArg().setLine( baseCommand[i] ); cli.createArg().setLine( "-Dbasedir=\'" + basedir.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-D" + PlexusAppBooterService.DEFAULT_NAME + PlexusAppBooterService.ENABLE_CONTROL_SOCKET + "=" + Boolean.TRUE.toString() ); cli.createArg().setLine( "-Dclassworlds.conf=\'" + classworldsConf.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-Dplexus.container.properties.file='" + containerProperties.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-cp" ); cli.createArg().setLine( "\'" + classworldsJar.getAbsolutePath() + "\'" ); cli.createArg().setLine( "org.codehaus.plexus.classworlds.launcher.Launcher" ); classworldsConf = writeConfig( config ); cli.createArg().setLine( "-Dclassworlds.conf=\'" + classworldsConf.getAbsolutePath() + "\'" ); cli.createArg().setLine( "-jar" ); cli.createArg().setLine( "\'" + platformFile.getAbsolutePath() + "\'" ); cli.createArg().setLine( Integer.toString( controlPort ) );
cli.createArg().setLine( "--settings \'" + settings.getAbsolutePath() + "\'" ); cli.createArg().setLine( "deploy:deploy-file" ); cli.createArg().setLine( "-Durl=\'" + repositoryUrl + "\'" ); cli.createArg().setLine( "-Dfile=\'" + fileToDeploy + "\'" ); cli.createArg().setLine( "-DgroupId=\'" + gav.getGroupId() + "\'" ); cli.createArg().setLine( "-DartifactId=\'" + gav.getArtifactId() + "\'" ); cli.createArg().setLine( "-Dversion=\'" + gav.getVersion() + "\'" ); cli.createArg().setLine( "-Dpackaging=\'" + gav.getExtension() + "\'" );
cmd.createArg().setLine(additionalJvmArgs);
cl.createArg().setLine( cmd );
cl.createArg().setLine( cmd );
@Override protected void executeCommand(Command command) { try { Commandline commandLine = new Commandline(); commandLine.setExecutable(command.getExecutable()); commandLine.setWorkingDirectory(command.getWorkingDir()); for (String arg : command.getArgEntriesAsList()) { commandLine.createArg().setLine(arg); } StringStreamConsumer outConsumer = new StringStreamConsumer(); StringStreamConsumer errConsumer = new StringStreamConsumer(); executeCommand(commandLine, outConsumer, errConsumer, model.isVerbose()); String out = outConsumer.getOutput(); FileUtils.fileWrite(new File(command.getBuildScriptPath() + ".log"), out); if (model.isFailOnError() && ( out.contains("com.ibm.ws.scripting.ScriptingException") || out.contains("com.ibm.bsf.BSFException"))) { throw new WebSphereServiceException("Failed to execute the task, Please see the log for more details"); } String error = errConsumer.getOutput(); if (StringUtils.isNotEmpty(error)) { System.err.println(error); } } catch (CommandLineTimeOutException e) { throw new WebSphereServiceException("Failed to execute the task." + "Please ensure remote WAS or Deployment Manager is running. " + e.getMessage(), e); } catch (Exception e) { throw new WebSphereServiceException(e.getMessage(), e); } }
cmdLine.setExecutable(jvmBinary); if (argLine != null) { cmdLine.createArg().setLine(argLine.replace("\n", " ").replace("\r", " "));
public static Commandline getBaseCommand( String commandName, GitScmProviderRepository repo, ScmFileSet fileSet, String options ) { Settings settings = GitUtil.getSettings(); Commandline cl = new Commandline(); cl.setExecutable( settings.getGitCommand() ); cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); if ( settings.getTraceGitCommand() != null ) { cl.addEnvironment( "GIT_TRACE", settings.getTraceGitCommand() ); } cl.createArg().setLine( options ); cl.createArg().setValue( commandName ); return cl; }
public static Commandline getBaseCommand( String commandName, GitScmProviderRepository repo, ScmFileSet fileSet, String options ) { Settings settings = GitUtil.getSettings(); Commandline cl = new Commandline(); cl.setExecutable( settings.getGitCommand() ); cl.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() ); if ( settings.getTraceGitCommand() != null ) { cl.addEnvironment( "GIT_TRACE", settings.getTraceGitCommand() ); } cl.createArg().setLine( options ); cl.createArg().setValue( commandName ); return cl; }
command.createArg().setLine( "\"" + message + "\"" );
command.createArg().setLine( "\"" + message + "\"" );
cl.createArg().setLine( options );
cl.createArg().setLine( options );
cmd.createArg().setLine(argStr);