Batch file scripts are text files that contain commands that can be executed from Windows command intepreter.In this tutorial we will
see how excecute maven commands such as mvn clean or mvn install from a batch file script.

In order to execute a meven command all we need is the

call

command.As an example consider the following example:

 

@echo on
SET PPROJECT_PATH=C:\workspace


cd %PROJECT_PATH%\project\
call mvn clean

Call command is not only useful for executing single maven commands but using call command you can call more than one maven commands from the same script.
For example:

@echo on
SET PPROJECT_PATH=C:\workspace


cd %PROJECT_PATH%\project\
call mvn clean
call mvn install

As a result you can make more advanced batch files where you could for example build and deploy your application