Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the-pl-am-amd parameter of Maven

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail what the-pl-am-amd parameters of Maven are, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Yesterday, maven's deploy task needs to select only a single module and package the modules it depends on. I immediately thought of the-pl parameter, and then began to deal with it, but because I only saw the introduction of the command before, it took nearly half an hour to fully run through, so record this article.

Assume that the existing project structure is as follows

Dailylog-parent

| |-dailylog-common |

| |-dailylog-web |

Three folders are in the same directory

Dailylog-web depends on dailylog-common

Dailylog-parent manages dailylog-common and dailylog-web.

According to the information, it is known:

Explanation of the full name of the parameter-pl--projectsBuild specified reactor projects instead of all projects

Option can be followed by {groupId}: {artifactId} or the relative path of the selected module (multiple modules are separated by commas)

-am--also-makeIf project list is specified, also build projects required by the list

Indicates that the module on which the selected module depends is processed at the same time

-amd--also-make-dependentsIf project list is specified, also build projects that depend on projects on the list

Indicates that modules that depend on the selected module are processed at the same time

-N--Non-recursiveBuild projects without recursive

Represents a non-recursive sub-module

-rf--resume-fromResume reactor from specified project

Indicates that processing continues from the specified module

The following is the experiment in maven-3.3.9

1. Run `mvn clean install-pl org.lxp:dailylog-web-am` in the dailylog-parent directory, and the result

Dailylog-common was successfully installed to the local library

Dailylog-parent was successfully installed to the local library

Dailylog-web was successfully installed to the local library

This command is equivalent to `mvn clean install-pl.. / dailylog-web-am`

two。 Run `mvn clean install-pl.. / dailylog-common-am` in the dailylog-parent directory, and the result

Dailylog-common was successfully installed to the local library

Dailylog-parent was successfully installed to the local library

3. Run `mvn clean install-pl.. / dailylog-common-amd` in the dailylog-parent directory, and the result

Dailylog-common was successfully installed to the local library

Dailylog-web was successfully installed to the local library

Because dailylog-parent does not rely on dailylog-common modules, it is not installed

4. Run `mvn clean install-pl.. / dailylog-common,../dailylog-parent-amd` in the dailylog-parent directory, and the result

Dailylog-common was successfully installed to the local library

Dailylog-parent was successfully installed to the local library

Dailylog-web was successfully installed to the local library

5. Run `mvn clean install-N` in the dailylog-parent directory, and the result

Dailylog-parent was successfully installed to the local library

-N means no recursion, then the submodules managed by dailylog-parent will not be installed at the same time

6. Run `mvn clean install-pl.. / dailylog-parent-N` in the dailylog-parent directory, and the result

Dailylog-parent was successfully installed to the local library

7. Run `mvn clean install-rf.. / dailylog- common` in the dailylog-parent directory, and the result

Dailylog-common was successfully installed to the local library

Dailylog-web was successfully installed to the local library

On the Maven-pl-am-amd parameter is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report