Maven Guide

Time:2019-12-12

What is maven


Maven project object model (POM), a project management tool software that can manage project construction, reporting and documentation through a short description of information.
    Maven offers advanced project management tools in addition to program building capabilities. Because Maven's default build rules are high
    Reusability, so you can often build simple projects with two or three lines of Maven build scripts. Because of Maven's project-oriented approach,
    Many Apache Jakarta projects use Maven when they publish, and the proportion of companies' projects using Maven is growing. Maven this.
    The word comes from Yiddish (Jewish), meaning the accumulation of knowledge, which was originally used in the Jakata turbine project to simplify the construction process. at that time
    There are some projects (with their own ant build files), with only minor differences, and jar files are maintained by CVS. So I hope there is a standard
    Build the project in a clear way, define the composition of the project, publish the information of the project in an easy way, and a simple way
    Share jars across multiple projects.

    Maven is a project management tool, which contains a project object model, a set of standards, a
    Project lifecycle, a dependency management system, and the
    Define the logic of the plugin goal in the phase of the lifecycle. When you use maven, you use a clear
    Project object model to describe your project, and then Maven can apply crosscutting logic from a shared (or custom) set
    Plug in.
    
    Maven has a lifecycle that is called when you run MVN install. This command tells Maven to execute a series of
    Step by step until you reach the life cycle you specify. One of the effects of traversing the life cycle is that Maven runs a number of default
    Plug in goals, which do the work of compiling and creating a jar file. Besides, Maven can help you manage it easily
    Project reports, generating sites, managing jar files, and so on.

1.1 installation


Maven official website: https://maven.apache.org/
   Maven download address: https://maven.apache.org/download.cgi

As shown in the picture:
Maven Guide

Select one of the Downloads
Unzip after download
    
You can see the following directory:
    Bin: this directory contains Maven scripts. Contains the scripts run by MVN, which are called by entering any command in this directory
    Boot: this directory has only one plexus-classworlds-2.5.2.jar, which is used by Maven's class loading framework to load its own classes
          Library, which provides richer syntax and configuration than the default Java classloader
    Config: this directory contains Maven configuration files, and you can customize Maven behavior globally. Usually, settings.xml is copied to ~ /. M2 /,
            Customize Maven behavior at the user level. The compiler will first read the settings.xml file in the ~ /. M2 directory, if not
            The settings.xml file will only be read in the Maven installation directory after reading it.
    Lib: this directory contains the Java class libraries required by Maven runtime. One of the important points is that you can find the built-in super of Maven under the Lib package
         Level POM is usually stored in a jar package called Maven model builder

If you want to run directly on CMD, you need to set the path in the environment variable. It's not going to be explained here.

1.2 installation of local warehouse


Modify the setting.xml of config in the Maven directory to open < localrepository > and set the address of the local warehouse in the tag,
   Then the jar packages of all projects are installed in this directory
   
   Such as:
       <localRepository>D:\Inkstone\maven\repository</localRepository>

Create a maven project


First create a root directory, if D: \ example
Run MVN archetype: generate in the D: \ example directory
Then a project skeleton will be generated in this directory

Pictured:
Maven Guide



POM file:

<project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                              http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>

     <groupId>com.sutpc.ioc</groupId>
     <artifactId>ioc_diciflow</artifactId>
     <version>SNAPSHOT-0.0.1</version>
     
     <dependencies>
        <dependency>
            <groupId>com.sutpc</groupId>
            <artifactId>framework-core</artifactId>
            <version>2.1.1</version>
        </dependency>
     <dependencies>
 </project>
 
Project coordinates
    Groupid: indicates the name of the project  
    Artifactid: indicates the module name of the project. It is recommended to use the name of the project - module name
    Version: indicates the version name of this project

Dependencies: project dependencies

1.3 create code and test code


Source code should be placed in Src / main / Java
The resource file of the source code should be placed in the Src / main / Resources folder
Test code should be placed in Src / test / Java
The resource file of the test code should be placed in the Src / test / Resources folder

1.4 running MVN


MVN clean -- > means to run the cleanup operation (the data in the target folder will be cleaned by default)
MVN clean compile -- > means to run cleanup first and then compile, and then compile the code into the target folder
MVN clean test -- > Run cleanup and test
MVN clean package -- > Run cleanup and packaging
MVN clean install -- > runs cleanup and installation, which installs the packed package into the local repository so that other projects can call
MVN clean deploy -- > Run cleanup and publish (publish to private server)

1.5 MVN common commands


mvn help:describe :
    Parameters: 
         1. -Dplugin=pluginName
         2. - dgoal (or - dmojo) = goalname: used with - dplugin, which lists the goal information of a plug-in
            This command will tell you which goal and its related parameters are included in an insert. If you don't think it's detailed enough, you can also add
            -Ddetail.
         Note: a plug-in goal is also considered a "mojo")
         
MVN archetype: generate: create Maven project, previously using MVN archetype: create - darchetypeartifactid=
                        maven-archetype-quickstart -DgroupId=com.ryanote -Dartifact=common,
                        The command is too long. Now just type archetype: generate, and the rest is to do multiple choice questions

MVN Tomcat: run: run the MVN tomat: run command in the corresponding directory, and you can run and view it in the browser
    Parameters:
         1. - dmaven. Test. Skip (= true) skip test
         2. - dmaven. Tomcat. Port = 9090 specify port
         3. - dmaven. Test. Failure. Ignore = true ignore test failure
         
    How to use this command:
    First add the dependency in the POM file:
    <! -- tomcat7 plug-in Maven command tomcat7: run start project -- >
    <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>2.2</version>
          <configuration>
            <port>8080</port>
            <path>/${project.artifactId}</path>
            <uriEncoding>${project.build.sourceEncoding}</uriEncoding>
          </configuration>
    </plugin>
    Tell POM the resource directory of the project
    <resources>
        <resource>
            <directory>src/main/java</directory>
            <includes>
              <include>**/*.xml</include>
              <include>**/*.sql</include>
              <include>**/*.ftl</include>
            </includes>
            <filtering>false</filtering>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
    Then run MVN Tomcat: run directly. Remember to change packaging to war
        
Mvndebug Tomcat: run: it is mainly used for remote testing. It will listen to the 8000 port used for remote testing. After opening remote testing in eclipse, it
                     It will run, set breakpoints, debug, everything is so simple. The above parameters are also applicable here
    Parameters:
         1. - dmaven. Test. Skip (= true) skip test
         2. - dmaven. Tomcat. Port = 9090 specify port
         3. - dmaven. Test. Failure. Ignore = true ignore test failure                         

MVN dependency: sources: run it, and you will have the source code of the jar package that your project depends on
MVN archetype: create - dgroupid = packagename - dartifactid = ProjectName: create a mavne project
MVN compile: compiling source code
MVN test compile: compiling test code
MVN test: run test     
MVN site: a website for generating project related information
MVN package: generate target directory, compile and test code, generate test report, and generate jar / war file
MVN install: install jar in local repository
MVN clean: clear the generated items  
MVN Eclipse: Eclipse: generating eclipse projects
MVN idea: Idea: generate idea project
MVN - DTest package: use the goal command in combination, such as package only but not test
MVN test compile: compile the content of the test
MVN jar: jar: jar package only
MVN test - skipping compile - skipping test compile: only test and not compile, nor test and compile
MVN Eclipse: clean: clear some system settings of eclipse
MVN - dwtpversion = 1.0 Eclipse: a web project for eclipse to generate WTP plug-ins
MVN - dwtpversion = 1.0 Eclipse: clean clears configuration information for eclipse projects (web projects)
MVN Eclipse: Eclipse: converting projects to eclipse projects
MVN - E: displays detailed error information
MVN validate: verify that the project is correct and that all required resources are available.
MVN test compile: compile project test code.
MVN integration test: processes and publishes packages in an environment where integration tests can run.
MVN verify: run any checks to verify that the package is valid and meets quality standards.    
MVN generate sources: generate any additional source code needed by the application, such as XDoclet.

Publish third-party jars to local and remote libraries at the same time:
mvn deploy:deploy-file -DgroupId=com -DartifactId=client -Dversion=0.1.0 -Dpackaging=jar -Dfile=d:\client-0.1.0.jar -DrepositoryId=maven-repository-inner -Durl=ftp://xxxxxxx/opt/maven/repository/

Publish the third-party jar to the local library:
mvn install:install-file -DgroupId=com -DartifactId=client -Dversion=0.1.0 -Dpackaging=jar -Dfile=d:\client-0.1.0.jar

Special attention

Differences among package, install and deploy

MVN clean package implements seven stages in turn: clean, resources, compile, testresources, testcomposite, test, jar (packaging).
MVN clean install implements 8 stages in turn: clean, resources, compile, testresources, testcompile, test compile, jar (package), install, etc.
MVN clean deploy implements 9 stages in turn, including clean, resources, compile, testresources, testcomposite, test, jar (packaging), install and deploy.
in other words:
    Package: the command completes the project compilation, unit testing, and packaging functions, but fails to pack the completed executable jar package (War package or other forms
            Deployment to local Maven warehouse and remote Maven private server warehouse
    Install: the command completes the project compilation, unit testing, and packaging functions, and at the same time, it puts the completed executable jar package (War package or other forms of
            Deploy to local Maven warehouse, but not to remote Maven private server warehouse
    Deploy: the command completes the project compilation, unit testing, and packaging functions, and at the same time, it completes the completed executable jar package (War package or other forms of
            Deployment to local Maven warehouse and remote Maven private server warehouse

2 Dependence


2.1 query of dependent packages


1. All dependencies are stored by coordinates (GAV -- > groupid, artifactid, version)
2. Some online warehouses provide coordinate query (http://mvnrepository.com)
3. Set dependency through < dependencies >

How does Maven search for dependencies?
  Maven will first query in the local warehouse. If there is no local warehouse, it will query in the central warehouse

2.2 scope of dependence


The dependency scope refers to the optional configuration of the < scope > tag: compile, test, provided, runtime, system, import

1. Compile: default value, no need to display the specified value. It is effective for compiling, testing and running three Classpaths. For example, whether spring core is compiling or testing,
            It will be used to run or not, so spring core must be a compilation scope
            
2. Test: only valid for the test classpath. When compiling the main code and running the project, the dependency cannot be used. The most typical example is JUnit, component
          It is only needed when testing, so its dependency scope is testing, so its dependency scope needs to be specified as < scope > test < / scope >
          The specified dependency range is not displayed and no error is reported, but the dependency will be added to the compiled and run
          Classpath. It's a waste of resources.

3. Provided: only valid for compiled and tested classpath, but not for running classpath. Typical is servlet API. Compile and test the
              This dependency is required for the project, but it is already provided by the web container at runtime, so the runtime does not need this dependency any more. If
              If the specified dependency range is not displayed, and the version of the container depends on is inconsistent with that of maven, version conflicts may occur

4. Runtime: it is only valid for the classpath of test and run, but not for compiled classpath. A typical example is the driver implementation of JDBC, and the main code of the project
             When compiling, you only need the JDBC interface provided by the JDK, and only when testing and running, you need to implement the specific jdbc driver of the above interface

5. System: the relationship with classpath is exactly the same as the provided dependency range, but the system dependency range must be displayed by configuring the SystemPath element
            Indicates the path of the specified dependency file. This kind of dependency is not resolved by Maven warehouse, and is often bound to the native system, which may cause the component to be unavailable
            Migration, so use with caution, the SystemPath element can reference environment variables:
            <dependency> 
                <groupId>javax.sql</groupId>
                <artifactId>jdbc-stext</artifactId> 
                <version>2.0</version>
                <scope>system</scope>
                <systemPath>${java.home}/lib/rt.jar</systemPath> 
           </dependency>

6. Import: does not affect the three Classpaths. The dependency scope can only be used with the dependencymanagement element. Its function is to set the target
           The configuration import of dependency management in POM file is merged into the dependency management of current POM
           For example: there is a parent project a, and now there is a project C to use project a, you can
            <dependencyManagement>
                   <dependencies>
                       <! -- here, the project a and B are inherited. The type is POM, and the scope is import -- >
                       <dependency>
                           <groupId>com.cbm.stu</groupId>
                           <artifactId>maven-parent-a</artifactId>
                           <version>1.0.0</version>
                           <type>pom</type>
                           <scope>import</scope>
                       </dependency>
                       <dependency>
                           <groupId>com.cbm.stu</groupId>
                           <artifactId>maven-parent-b</artifactId>
                           <version>1.0.0</version>
                           <type>pom</type>
                           <scope>import</scope>
                       </dependency>
                   </dependencies>
               </dependencyManagement>

               <dependencies>
                   <! -- inherit dependency from inherited parent project -- >
                   <dependency>
                       <groupId>junit</groupId>
                       <artifactId>junit</artifactId>
                   </dependency>
                   <dependency>
                       <groupId>org.mybatis</groupId>
                       <artifactId>mybatis</artifactId>
                   </dependency>
                   <dependency>
                       <groupId>mysql</groupId>
                       <artifactId>mysql-connector-java</artifactId>
                   </dependency>
               </dependencies>

2.3 transitivity of dependency


Now there is Maven project a, project B depends on a, and project C depends on B. at this time, if project C is executed, both a and B dependencies will be automatically downloaded to the jar package folder of project C.
This is the transitivity of dependence
     
    If you do not want to download a from C now, use the < exclusions > tab
     <dependencies>
         <dependency>
             <groupId>B</groupId>
             <artifactId>B</artifactId>
             <version>0.0.1</version>
              <exclusions>
                 <exclusion>
                   <! -- excluded dependency package coordinates -- >
                   <groupId>A</groupId>
                   <artifactId>A</artifactId>
                   <version>0.0.1</version>
                 </exclusion>
              </exclusions>
        </dependency>
     </dependencies>

2.3.1 dependency conflict and resolution


Dependency conflict: there is a project a that depends on D through different dependency delivery paths. If different versions of D are passed through different paths, which version should be imported
         Bag?
         1. If the dependent path length does not appear, "short circuit priority":  
              A -> B -> C -> D(version 0.0.1)
              A -> F -> D(version 0.0.2)        
            Then a depends on D (version 0.0.2) 
         2. Dependency if the length is the same, "declare priority first"
              A -> B -> D(version 0.0.1)
              A -> F -> D(version 0.0.2)        
            In < dependencies > of project a, which of B, f depends on D of that path first

2.4 aggregation and inheritance


Maven Guide
As shown in the figure above:

Aggregate projects through modules
Note: if the aggregated project and other projects are in the same level module, you need to use the.. / XX folder name to set

For dependent inheritance, it needs to be managed through < / dependency Management >. If you don't manage the subclasses, you will inherit all of them, which may lead to some problems
Module has unwanted dependencies

2.5 version management


< major version >. < minor version >. < incremental version > - < milestone version >   
     Main version: indicates the change of framework, such as Maven 2 and Maven 1 are far from each other; struts1 and Struts2 adopt different architectures.
     Minor version: indicates a large range of function additions and changes, and bug fixes. For example, nexus 1.5 added LDAP support over 1.4, and fixed
            A lot of bugs, but in terms of the overall architecture, nothing has changed.
     Minor version number: fix bugs on the branch version
 
 Milestone: snapshot -- > alpha -- > beta -- > release -- > GA

3 warehouse


The warehouses used in Maven project are as follows:

1. Central warehouse, which is the default warehouse
2. Image warehouse, configured through settings.mirrors.mirror in settings.xml
3. The global profile warehouse is configured through settings.repositories.repository in settings.xml
4. The project warehouse is configured through project.repositories.repository in pom.xml
5. The project profile warehouse is configured through project.profiles.profile.repositories.repository in pom.xml
6. Local warehouse

3.1 local warehouse


Set setting.config in config under Maven directory
<localRepository>D:\Inkstone\maven\repository</localRepository>

3.2 image warehouse


The content of setting.config in config under Maven directory is as follows:

<settings>
  <mirrors>
    <mirror>
      <id>settings_mirror</id>
      <url>https://maven.aliyun.com/repository/public</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
</settings>

3.3 global profile warehouse


The setting node in setting.config in the Maven directory is added

<profiles>
  <profile>
  <id>s_profile</id>
  <repositories>
    <repository>
      <id>settings_profile_repo</id>
      <name>netease</name>
      <url>http://mirrors.163.com/maven/repository/maven-public/</url>
      <releases>
         <enabled>true</enabled>
      </releases>
      <snapshots>
         <enabled>true</enabled>
      </snapshots>
    </repository>
  /repositories>
  </profile>
</profiles>

3.4 project warehouse


Add the following configuration in project:

 <repositories>
   <repository>
     <id>pom_repositories</id>
     <name>local</name>
     <url>http://localhost:8081/nexus/content/groups/public/</url>
     <releases>
       <enabled>true</enabled>
     </releases>
     <snapshots>
       <enabled>true</enabled>
     </snapshots>
   </repository>
 </repositories>
  • Since we changed the name of the ID, the warehouse address doesn’t matter. Using the same address doesn’t affect the test.

3.5 configuration project profile warehouse


<profiles>
  <profile>
    <id>p_profile</id>
    <repositories>
      <repository>
        <id>pom_profile_repo</id>
        <name>local</name>
        <url>http://10.18.29.128/nexus/content/groups/public/</url>
        <releases>
          <enabled>true</enabled>
        </releases>
        <snapshots>
          <enabled>true</enabled>
        </snapshots>
      </repository>
    </repositories>
  </profile>
</profiles>

3.6 special attention

  • Settings? Mirror takes precedence over Central
  • Settings? Profile? Repo takes precedence over settings? Mirror
  • Settings? Profile? Repo has priority over POM? Repositories
  • Settings? Profile? Repo takes precedence over POM? Profile? Repo
  • POM? Profile? Repo has a higher priority than POM? Repositories
  • POM repository takes precedence over settings mirror

That is, local > Settings > profile > POM > profile > POM > repositories > Settings > mirror > Central

The search order that the project depends on: https://my.oschina.net/poly/


3.6 local warehouse


3.6.1 installation of Nexus


About this installation, I found the installation package on the official website, but I don't know why I can't download it, either the latest or the old version.
   
   Solution: Baidu
   Baidu result: find a Baidu cloud link, but the version is a little old. nexus-2.12.0-01-bundle
   Link: https://pan.baidu.com/s/1yvujg4yb9f0my5ggsqj5ya password: 8j5n    
   If it fails, join our QQ group: 709571289
   Unzip after download
   Nexus-2.12.0-01-bundle \ nexus-2.12.0-01 \ bin \ JSW to this directory depends on what system you are, click the corresponding system startup script
   It's OK.

###3.6.2 warehouse


Maven Guide

As shown in the figure above:

  • Host warehouse: refers to the release warehouse of internal projects

    1. Third party: refers to the warehouse on which the third party depends. This data is usually downloaded by internal personnel and then released to the warehouse
    2. Snapshots: indicates the internal snapshot module warehouse
    3. Releases: release module release warehouse in internal modules
  • Proxy warehouse, looking for data warehouse from remote central warehouse

    1. Apache snapshots: the component repository of the snapshot version of the agent Apache Maven repository
    2. Central snapshots: the repository for the snapshot version component of the agent codehausmaven repository
    3. Central: the agent of Maven central warehouse to release version components

3.6.3 setting:


1. Configure image
      <mirrors>
           <mirror>
            <id>central</id>
            <mirrorOf>*</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://localhost:8081/nexus/content/groups/public/</url>
         </mirror>
      </mirrors>
      
      *: indicates that all the warehouse information is obtained from here. You can also use nexus.central, which indicates that the warehouse with ID nexus and central can be mirrored
      
2. Configure warehouse  
       <profiles>
           <profile>
             <id>central-repos</id>
          <repositories>
               <repository>
                <id>central</id>
                 <name>Central</name>
                 <url>http://central</url>
                    <releases><enable>true</enable></releases>
                   <snapshots>
                       <enabled>true</enabled>
                    </snapshots>
               </repository>
            </repositories>
        </profile>   
        
  URL: after the image is configured, the URL is meaningless
  Release: opens the dependency on release. Open by default
  Snapshots: the dependency to open a snapshot. It is not opened by default

3.6.3 project release


1. Set release factory and snapshots factory
      <distributionManagement>
            <snapshotRepository>
                <id>example-snapshots</id>
                <name>example Project SNAPSHOTS</name>
                <url>http://192.168.0.199:8081/nexus/content/repositories/MyUserReposSnapshots/</url>
            </snapshotRepository>     
                  <repository>
                      <id>example-releases</id>
                      <name>example Project Release</name>
                      <url>http://192.168.0.199:8081/nexus/content/repositories/MyUserReposRelease/</url>
                  </repository>      
              </distributionManagement>
2. Set access rights
      <servers>
                 <server>
                 <id>example-snapshots</id>
                     <username>kh</username>
                      <password>123456</password>
                </server>

               <server>
                      <id>example-releases</id>
                    <username>kh</username>
                      <password>123456</password>
                  </server>

3.6.4 create project factory and set permissions


1. Create two factories: release and policy

Maven Guide

2. Configure permissions

Maven Guide
Maven Guide
Maven Guide

3. Create roles and assign permissions

Maven Guide

4. Create user

Maven Guide

5. Create a published factory

Maven Guide


4 life cycle


1. clean
   Pre clean performs some work that needs to be done before clean
   Clean removes all files generated by the last build
   Post clean performs some tasks that need to be completed immediately after clean
2. compile
   validate
   generate-sources
   process-sources
   generate-resources
   Process resources copies and processes the resource files to the target directory for packaging.
   Compile compiles the source code of the project.
   process-classes
   generate-test-sources 
   process-test-sources 
   generate-test-resources
   Process test resources copies and processes the resource files to the target test directory.
   Test compile compiles the test source code.
   process-test-classes
   Test runs the test using the appropriate unit test framework. The test code will not be packaged or deployed.
   prepare-package
   Package accepts compiled code and packages it into a publishable format, such as jar.
   pre-integration-test
   integration-test
   post-integration-test
   verify
   Install installs the package to the local repository to make other projects dependent.
   Deploy copies the final package to a remote repository for other developers to share with the project. 
3. site
   Pre site performs some work that needs to be done before generating site documents
   Site generates site documents for the project
   Post site performs some work that needs to be done after the site documentation is generated and is ready for deployment
   Site deploy deploys the generated site documents to a specific server

5. plug-in


Plug in is the core of maven, and all operations performed are based on plug-ins. In order to achieve many similar functions in a plug-in, Maven sets the plug-in
There may be multiple goals in a plug-in. In fact, each important stage in the life cycle is executed by a specific goal of the plug-in.

Plug-ins have cycles, and Maven specifies the steps of plug-ins. After finishing an action, what is the next action? Each action is executed by the corresponding plug-in.
The Apache plug-ins are stored in the org \ Apache \ Maven directory in the Maven local warehouse.

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <mainClass>${start-class}</mainClass>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>   

As shown above: how to use plug-ins quickly?

  • Method 1: Baidu, this method can only understand the surface of plug-ins
  • Method 2: View API documents, such as Apache plug-ins:

    http://maven.apache.org/plugins/
               The document is very detailed, plug-in parameters, parameter use cases and so on. For documents that are not very detailed, you can see the source code
  • Method 3: check the source code

Maven Guide

Old version
Maven Guide
New version
Maven Guide

In the above two classes, Maven executes the execute () method as soon as it executes compile.

Maven Guide

Each target is a class: as shown in the figure below, this plug-in has two targets, compile and testcompile. In the new version, the parameters are @ parameter
Note to explain, the old version uses note

Maven Guide

#Example 1 if you want to generate jar packages from all the source files at the time of packaging

<plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
               <version>2.1.2</version>
               <executions>
                   <execution>
                       <phase>package</phase>
                       <goals>
                           <goal>jar-no-fork</goal>
                       </goals>
                   </execution>
               </executions>
          </plugin>
      </plugins>
  Phase: binding phase
Goal: the goal to run
For specific parameters, you can view the document or source code