What does mvn -P do?

I was told to use mvn clean install -P base at work to perform a specific task. I'm trying to find what exactly this means.

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

But when I typed mvn -P at the command line, I got an error message:

Unable to parse command line parameters: missing parameter for parameter: P

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

What are -P and -P what are they used for?

+13
source share
1 answer

The link tells us that -P indicates under which profile Maven should work. Projects can define several profiles, which can depend on different dependencies, so this is necessary if you have a project that can do this.

I did not encounter the -P flag in practice, and it does not seem to exist in modern versions of Maven.

+11
source

Source: https://habr.com/ru/post/979292/


All Articles