简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM