Father and son project

1, the establishment of a maven project, the project root POM
   <groupId> organize the project name </ groupId>
   <artifactId> the Account </ artifactId>
   <Version> 1.0.0-SNAPSHOT </ Version>
   <Package Penalty for> POM </ Package Penalty for>
   < modules>
      <Module1> Account-mail </ Module1>
      <Module1> Account-the persist </ Module1>
   </ modules>
2, the directory structure
   Account
      -pom.xml
      -acount-mail
        -pom.xml
      -accout-the persist
        - POM. XML
. 3, the sub key configuration
  <parent>
    <groupId> parentgroupid </ groupId>
    <artifactId> parentartifactid </ artifactId>
    <Version> parentversion </ Version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  Extracting common inheritable configuration element to the parent configuration
4, dependent on the configuration of the parent project attention, may only be configured to reduce, not actually incorporated depend.
   Submodule still have to rely on an explicit definition, but some elements may be omitted entries
   father POM defined
  <the dependencyManagement>
    <dependency> </ dependency>
  </ the dependencyManagement>
. 5, rely introduced into the polymerization parent project
  <the dependencyManagement>
    <dependency>
       <groupId> </ groupId>
       <artifactId> </ artifactId>
      <scope> import </ scope> --- into another parent project dependency declarations
    </ dependency>
  </ the dependencyManagement>
. 6, the polymerization of the parent project management plug, similar dependency management, does not affect the actual, only in order to simplify sub configuration
   will match from effect
   <the pluginManagement>
     <plugins> </ plugins>
   </ the pluginManagement>
7, all inherited super pom POM, defines the default convention
8, build order
mvn Clean the install
  -pl specified configuration module
  When specifying module configured -am, while constructing its dependencies, dependency advance
  when specifying module configured -amd, while sub-module configured
  -rf - based on the complete structure, the order specified in advance module configured

Guess you like

Origin www.cnblogs.com/justart/p/11519718.html