Class MavenInvoker

java.lang.Object
se.kth.depclean.util.MavenInvoker

public final class MavenInvoker extends Object
Utility class to execute Maven tasks from the command line.
  • Method Details

    • runCommand

      public static String[] runCommand(String cmd, File directory) throws IOException, InterruptedException
      Creates a native process to execute a custom command. This method is used to invoke maven plugins directly.
      Parameters:
      cmd - The command to be executed.
      directory - The working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
      Returns:
      The console output.
      Throws:
      IOException - In case of IO issues.
      InterruptedException - In case of IO issues.