[Solved] Java program to build and run a maven project [closed]


You can follow below approach to start:

  1. Create a batch/shell file to build your project using mvn/ant/gradle
    command. You would need Maven/Ant/Gradle installed in your system
    and environment variable needs to be setup properly.
  2. Run This batch/shell file using java by taking advantage of Runtime
    Class. Runtime.getRuntime().exec(“cmd /c start build.bat”);
  3. To schedule your java program, Use ExecutorService or Quartz. Or you
    can take advantage of Operating System Schedulers as well.

Hope this helps.

solved Java program to build and run a maven project [closed]