You can follow below approach to start:
- 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. - Run This batch/shell file using java by taking advantage of Runtime
Class. Runtime.getRuntime().exec(“cmd /c start build.bat”); - 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]