Search code examples
javamavencontinuous-integrationmaven-plugingithub-actions

What is the -B switch for in a Maven build? I see it in GitHub Actions but nowhere else


I'm working with GitHub Actions, and with every GitHub Actions Maven project I see the build file uses a -B package switch.

run: mvn -B package --file pom.xml

Maven standard switch or GitHub Actions feature?

I'm assuming -B just stands for build? Batch? But Googling around and even looking at the Apache Maven docs, I couldn't see the -B switch documented. All my searches simply took me back to other GitHub Actions YAML pages that use the switch without describing it.

Can anyone provide clarity on the meaning of the -B package switch and perhaps a link to some documentation on it?


Solution

  • According to the Apache Maven CLI Options Reference:

    -B,--batch-mode Run in non-interactive (batch) mode (disables output color)