List of usage examples for org.apache.maven.cli MavenCli MULTIMODULE_PROJECT_DIRECTORY
String MULTIMODULE_PROJECT_DIRECTORY
To view the source code for org.apache.maven.cli MavenCli MULTIMODULE_PROJECT_DIRECTORY.
Click Source Link
From source file:com.ibm.liberty.starter.it.api.v1.utils.MvnUtils.java
License:Apache License
public static int runMvnCommand(PrintStream outputStream, String tempDir, DownloadedZip zip, String... args) { String mvnMultiModuleProjectDirectory = tempDir + "/mvn/multi_module"; System.setProperty(MavenCli.MULTIMODULE_PROJECT_DIRECTORY, mvnMultiModuleProjectDirectory); MavenCli cli = new MavenCli(); return cli.doMain(args, zip.getLocation(), outputStream, outputStream); }
From source file:com.planet57.maven.shell.commands.maven.MavenCommand.java
License:Open Source License
public Object execute(final CommandContext context) throws Exception { assert context != null; IO io = context.getIo();/* ww w . j av a2 s . com*/ Variables vars = context.getVariables(); CliRequestBuilder request = new CliRequestBuilder(); request.setArguments(strings(context.getArguments())); File baseDir = vars.get(SHELL_USER_DIR, File.class); request.setWorkingDirectory(baseDir); File projectDir = vars.get(MavenCli.MULTIMODULE_PROJECT_DIRECTORY, File.class, null); if (projectDir == null) { projectDir = findProjectDir(baseDir); } request.setProjectDirectory(projectDir); // Setup output colorization StreamSet current = StreamJack.current(); StreamSet streams; if (color == null || color) { // Complain if the user asked for color and its not supported if (color != null && !io.getTerminal().isAnsiSupported()) { log.warn("ANSI color is not supported by the current terminal"); } streams = new StreamSet(current.in, new ColorizingStream(current.out), new ColorizingStream(current.err)); } else { streams = current; } StreamJack.register(streams); int result = -1; try { MavenCli cli = new MavenCli(); result = cli.doMain(request.build()); } finally { StreamJack.deregister(); } return result; }