Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between interactive and batch mode in Maven?

Tags:

java

maven

I have created a Java application with the help of Maven plugin for using following maven goal:

mvn archetype:generate -DgroupId=net.javabeat    -DartifactId=SampleJavaProject   -DarchetypeArtifactId=maven-archetype-quick-start   -DinteractiveMode=false      

When -DinteractiveMode=false, then project is created in batch mode, and when -DinteractiveMode=true, then project is created in interactive mode.
I'm confused with interactive mode and batch mode. What are those?

like image 999
Maulik Patel Avatar asked Sep 17 '14 16:09

Maulik Patel


People also ask

Which run option can you use to call maven 2 in non interactive mode?

To run Maven in batch mode use the following option: -B, --batch-mode. Run in non-interactive (batch) mode. Batch mode is essential if you need to run Maven in a non-interactive, continuous integration environment.


2 Answers

The batch-mode will automatically use default values instead of asking you via prompt for those values. The batch-mode can also be activated via --batch-mode or -B on command line.

like image 62
khmarbaise Avatar answered Oct 06 '22 17:10

khmarbaise


Batch mode causes Maven to not display "Progress: 125/150kB" style lines when running. If you are running Maven on some server and then checking the logs afterwards, these progress lines take up 90% of the log and make it basically impossible to find the stuff that matters. Setting batch mode prevents this. Apart from that, I don't know any other use for batch mode. As others have said, I have never seen Maven prompt for anything during a build, regardless of whether interactive or batch mode is set.

like image 36
Adam Burley Avatar answered Oct 06 '22 15:10

Adam Burley