Suppose an existing project is structured as follows
dailylog-parent
| -dailylog-common
| -dailylog-web
- Three folders at the same level directory
- dailylog 依赖 dailylog-web-common
- dailylog-parent-common dailylog 管理 和 dailylog-web.
According to the information known:
parameter | Full name | DEFINITIONS | Explanation |
-pl | --projects | Build specified reactor projects instead of all projects | After the option to follow the {groupId}: {artifactId} or relative path of the selected module (plurality of modules separated by commas) |
-am | --also-make | If project list is specified, also build projects required by the list | Represents simultaneous processing modules depend on the selected module |
-amd | --also-make-dependents | If project list is specified, also build projects that depend on projects on the list | At the same time the processing module represents the selected module dependent |
-N | --Non-recursive | Build projects without recursive | He said they did not recursive sub-module |
-rf | --resume-from | Resume reactor from specified project | It represents the start process continues from the specified module |
The following are the tests of maven-3.3.9
1. dailylog-parent directory run `mvn clean install -pl org.lxp: dailylog-web -am`, results
- dailylog-common successfully installed to the local library
- dailylog-parent successfully installed to the local library
- dailylog-web successfully installed to the local library
This command is equivalent to `mvn clean install -pl ../dailylog-web -am`
2. dailylog-parent directory run `mvn clean install -pl ../dailylog-common -am`, results
- dailylog-common successfully installed to the local library
- dailylog-parent successfully installed to the local library
3. dailylog-parent directory run `mvn clean install -pl ../dailylog-common -amd`, results
- dailylog-common successfully installed to the local library
- dailylog-web successfully installed to the local library
Since dailylog-parent dailylog-common module is not dependent, it has not been installed
4. dailylog-parent directory, run `mvn clean install -pl ../dailylog-common,../dailylog-parent -amd`, results
- dailylog-common successfully installed to the local library
- dailylog-parent successfully installed to the local library
- dailylog-web successfully installed to the local library
5. dailylog-parent directory, run `mvn clean install -N`, results
- dailylog-parent successfully installed to the local library
-N means no recursion, so dailylog-parent management sub-module is not installed
6. dailylog-parent directory run `mvn clean install -pl ../dailylog-parent -N`, results
- dailylog-parent successfully installed to the local library
7. dailylog-parent directory, run `mvn clean install -rf ../ dailylog-common`, results
- dailylog-common successfully installed to the local library
- dailylog-web successfully installed to the local library
The documents from: