When executing mvn test -f file-directory and mvn test -pl project.
What is the difference in internal execution of the both ? 
-f,--file <arg> Force the use of an alternate POM file. -pl,--projects <arg> Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.
If you have just installed Maven, it may take a while on the first run. This is because Maven is downloading the most recent artifacts (plugin jars and other files) into your local repository. You may also need to execute the command a couple of times before it succeeds.
Profiles can be activated in the Maven settings, via the <activeProfiles> section. This section takes a list of <activeProfile> elements, each containing a profile-id inside. Profiles listed in the <activeProfiles> tag would be activated by default every time a project use it.
From mvn -help
 -f,--file <arg>                        Force the use of an alternate POM
                                        file.
 -pl,--projects <arg>                   Comma-delimited list of specified
                                        reactor projects to build instead
                                        of all projects. A project can be
                                        specified by [groupId]:artifactId
                                        or by its relative path.
Example Usage:
-f 
-pl 
Given this project structure ...
+- tools
| |
| +- build
| |
+- projects
| |
| +- parent
|    |
|    +- pom.xml
|  
| +- childA
|    |
|    +- pom.xml
| +- childB
|    |
|    +- pom.xml
You could ...
parent project from the tools/build directory by using -f e.g.
cd tools/build; mvn -f ../../projects/parent/pom.xmltools/build directory by using -f and -pl e.g.
cd tools/build; mvn -f ../../projects/parent/pom.xml -pl parent:childA  parent directory by using -pl e.g.
cd projects/parent; mvn -pl parent:childBIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With