24

I have been told to use mvn clean install -P base at work for a particular task. I am trying to find what it exactly means.

According to https://maven.apache.org/archives/maven-1.x/reference/command-line.html , -P lists all available plugins; and -p is used to specify a project file (assuming pom).

But when I typed mvn -P in my command line, I got an error saying:

Unable to parse command line options: Missing argument for option: P

usage: mvn [options] [<goal(s)>] [<phase(s)>]

What do the -P and -p stand for, and what are they used for exactly?

Lii
  • 11,553
  • 8
  • 64
  • 88
Gadam
  • 2,674
  • 8
  • 37
  • 56

1 Answers1

26

A reference tells us that -P specifies which profile Maven is to run under. Projects can define multiple profiles which may pull in different dependencies, so this is required if you have a project that can do that.

The -p flag isn't one I've run into in practice, nor does it really seem to exist in modern versions of Maven.

Makoto
  • 104,088
  • 27
  • 192
  • 230