Skip to content


Browse files Browse the repository at this point in the history
shell - trying to fallback to ivy dependency resolution from pom.xml …
…if we detect mvn is not installed on current machine
  • Loading branch information
fcamblor committed Sep 9, 2017
1 parent 85539e4 commit 6b1334d
Showing 1 changed file with 17 additions and 6 deletions.
Expand Up @@ -37,6 +37,8 @@
public class DepsShellCommand extends StdShellCommand {
private static final String MVN_COMMAND = "mvn";

public DepsShellCommand() {
super(ImmutableList.of("deps"), "deps related commands: install / update / manage app dependencies");
Expand Down Expand Up @@ -154,16 +156,25 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOEx

// Then copying dependencies through copy-dependencies plugin
ProcessBuilder mavenCmd = new ProcessBuilder(
"mvn", "org.apache.maven.plugins:maven-dependency-plugin:3.0.1:copy-dependencies",
MVN_COMMAND, "org.apache.maven.plugins:maven-dependency-plugin:3.0.1:copy-dependencies",
"-DoutputDirectory=" + dependenciesDir.toAbsolutePath(), "-DincludeScope=runtime"

shell.println("Executing `"+mavenCmd+"` ...");
try {
} catch(IOException e) {
if(e.getMessage().startsWith(String.format("Cannot run program \"%s\"", MVN_COMMAND))) {
shell.println("Looks like mvn is not installed here ... trying to fallback installing pom.xml file with Ivy...");
installDepsFromIvyDescriptor(shell, pomFile);
} else {

private static void storeModuleDescriptorMD5File(RestxShell shell, ModuleDescriptorType mdType) throws IOException {
Expand Down

0 comments on commit 6b1334d

Please sign in to comment.