Gadam
Gadam

Reputation: 3024

What does "mvn -P" do?

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?

Upvotes: 28

Views: 29841

Answers (1)

Makoto
Makoto

Reputation: 106450

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.

Upvotes: 28

Related Questions