maven POM.xml 标签详解

maven POM.xml 标签详解

转载 自http://blog.csdn.net/sunzhenhua0608/article/details/32938533
 

 pom作为项目对象模型。通过xml表示maven项目,使用pom.xml来实现。主要描述了项目:包括配置文件;开发者需要遵循的规则,缺陷管理系统,组织和licenses,项目的url,项目的依赖性,以及其他所有的项目相关因素。

[xml]
 
    1. <span style="padding:0px;margin:0px;"><project xmlns="http://maven.apache.org/POM/4.0.0"     
    2.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     
    3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">
  1.       
  2.     <parent>    
  3.          
  4.      <artifactId/>    
  5.          
  6.      <groupId/>    
  7.          
  8.      <version/>    
  9.          
  10.      <relativePath/>    
  11.  parent>    
  12.         
  13.     <modelVersion>4.0.0modelVersion>     
  14.          
  15.     <groupId>asia.banseongroupId>     
  16.          
  17.     <artifactId>banseon-maven2artifactId>     
  18.          
  19.     <packaging>jarpackaging>     
  20.          
  21.     <version>1.0-SNAPSHOTversion>     
  22.          
  23.     <name>banseon-mavenname>     
  24.          
  25.     <url>http://www.baidu.com/banseonurl>     
  26.          
  27.     <description>A maven project to study maven.description>     
  28.         
  29.  <prerequisites>    
  30.       
  31.     <maven/>    
  32.  prerequisites>    
  33.       
  34.     <issueManagement>    
  35.           
  36.         <system>jirasystem>     
  37.             
  38.         <url>http://jira.baidu.com/banseonurl>     
  39.     issueManagement>     
  40.         
  41.  <ciManagement>    
  42.       
  43.   <system/>    
  44.       
  45.   <url/>    
  46.       
  47.   <notifiers>    
  48.        
  49.    <notifier>    
  50.         
  51.     <type/>    
  52.         
  53.     <sendOnError/>    
  54.         
  55.     <sendOnFailure/>    
  56.         
  57.     <sendOnSuccess/>    
  58.         
  59.     <sendOnWarning/>    
  60.         
  61.     <address/>    
  62.         
  63.     <configuration/>    
  64.    notifier>    
  65.   notifiers>    
  66.  ciManagement>    
  67.      
  68.     <inceptionYear/>    
  69.          
  70.     <mailingLists>    
  71.           
  72.         <mailingList>     
  73.              
  74.             <name>Demoname>     
  75.                  
  76.             <post>[email protected]post>     
  77.                  
  78.             <subscribe>[email protected]subscribe>     
  79.                  
  80.             <unsubscribe>[email protected]unsubscribe>     
  81.                 
  82.             <archive>http:/hi.baidu.com/banseon/demo/dev/archive>     
  83.         mailingList>     
  84.     mailingLists>     
  85.          
  86.     <developers>     
  87.          
  88.         <developer>     
  89.              
  90.             <id>HELLO WORLDid>     
  91.                 
  92.             <name>banseonname>     
  93.                 
  94.             <email>[email protected]email>     
  95.                 
  96.             <url/>    
  97.                 
  98.             <roles>     
  99.                 <role>Project Managerrole>     
  100.                 <role>Architectrole>     
  101.             roles>    
  102.                 
  103.             <organization>demoorganization>     
  104.                 
  105.             <organizationUrl>http://hi.baidu.com/banseonorganizationUrl>     
  106.                 
  107.             <properties>     
  108.                 <dept>Nodept>     
  109.             properties>    
  110.                 
  111.             <timezone>-5timezone>     
  112.         developer>     
  113.     developers>     
  114.          
  115.     <contributors>    
  116.          
  117.      <contributor>    
  118.    <name/><email/><url/><organization/><organizationUrl/><roles/><timezone/><properties/>    
  119.      contributor>         
  120.     contributors>       
  121.          
  122.     <licenses>    
  123.           
  124.         <license>    
  125.              
  126.             <name>Apache 2name>     
  127.                 
  128.             <url>http://www.baidu.com/banseon/LICENSE-2.0.txturl>     
  129.                 
  130.             <comments>A business-friendly OSS licensecomments>     
  131.         license>     
  132.     licenses>     
  133.          
  134.     <scm>     
  135.              
  136.         <connection>     
  137.             scm:svn:http://svn.baidu.com/banseon/maven/banseon/banseon-maven2-trunk(dao-trunk)      
  138.         connection>     
  139.             
  140.         <developerConnection>     
  141.             scm:svn:http://svn.baidu.com/banseon/maven/banseon/dao-trunk      
  142.         developerConnection>    
  143.             
  144.         <tag/>           
  145.              
  146.         <url>http://svn.baidu.com/banseonurl>     
  147.     scm>     
  148.          
  149.     <organization>     
  150.          
  151.         <name>demoname>     
  152.             
  153.         <url>http://www.baidu.com/banseonurl>     
  154.     organization>    
  155.         
  156.     <build>    
  157.          
  158.   <sourceDirectory/>    
  159.       
  160.   <scriptSourceDirectory/>    
  161.       
  162.   <testSourceDirectory/>    
  163.       
  164.   <outputDirectory/>    
  165.       
  166.   <testOutputDirectory/>    
  167.       
  168.   <extensions>    
  169.        
  170.    <extension>    
  171.         
  172.     <groupId/>    
  173.         
  174.     <artifactId/>    
  175.         
  176.     <version/>    
  177.    extension>    
  178.   extensions>    
  179.       
  180.   <defaultGoal/>    
  181.       
  182.   <resources>    
  183.        
  184.    <resource>    
  185.         
  186.     <targetPath/>    
  187.         
  188.     <filtering/>    
  189.         
  190.     <directory/>    
  191.         
  192.     <includes/>    
  193.         
  194.     <excludes/>    
  195.    resource>    
  196.   resources>    
  197.       
  198.   <testResources>    
  199.        
  200.    <testResource>    
  201.     <targetPath/><filtering/><directory/><includes/><excludes/>    
  202.    testResource>    
  203.   testResources>    
  204.       
  205.   <directory/>    
  206.       
  207.   <finalName/>    
  208.       
  209.   <filters/>    
  210.       
  211.   <pluginManagement>    
  212.        
  213.    <plugins>    
  214.         
  215.     <plugin>    
  216.          
  217.      <groupId/>    
  218.          
  219.      <artifactId/>    
  220.          
  221.      <version/>    
  222.          
  223.      <extensions/>    
  224.          
  225.      <executions>    
  226.           
  227.       <execution>    
  228.            
  229.        <id/>    
  230.            
  231.        <phase/>    
  232.            
  233.        <goals/>    
  234.            
  235.        <inherited/>    
  236.            
  237.        <configuration/>    
  238.       execution>    
  239.      executions>    
  240.          
  241.      <dependencies>    
  242.           
  243.       <dependency>    
  244.        ......    
  245.       dependency>    
  246.      dependencies>         
  247.          
  248.      <inherited/>    
  249.          
  250.      <configuration/>    
  251.     plugin>    
  252.    plugins>    
  253.   pluginManagement>    
  254.       
  255.   <plugins>    
  256.        
  257.    <plugin>    
  258.     <groupId/><artifactId/><version/><extensions/>    
  259.     <executions>    
  260.      <execution>    
  261.       <id/><phase/><goals/><inherited/><configuration/>    
  262.      execution>    
  263.     executions>    
  264.     <dependencies>    
  265.          
  266.      <dependency>    
  267.       ......    
  268.      dependency>    
  269.     dependencies>    
  270.     <goals/><inherited/><configuration/>    
  271.    plugin>    
  272.   plugins>    
  273.  build>    
  274.      
  275.  <profiles>    
  276.       
  277.   <profile>    
  278.        
  279.    <id/>    
  280.        
  281.     <activeByDefault/>    
  282.         
  283.     <jdk/>    
  284.         
  285.     <os>    
  286.          
  287.      <name>Windows XPname>    
  288.          
  289.      <family>Windowsfamily>    
  290.          
  291.      <arch>x86arch>    
  292.          
  293.      <version>5.1.2600version>    
  294.     os>    
  295.         
  296.      <name>mavenVersionname>    
  297.          
  298.      <value>2.0.3value>    
  299.     property>    
  300.         
  301.      <exists>/usr/local/hudson/hudson-home/jobs/maven-guide-zh-to-production/workspace/exists>    
  302.          
  303.      <missing>/usr/local/hudson/hudson-home/jobs/maven-guide-zh-to-production/workspace/missing>    
  304.     file>    
  305.    activation>    
  306.        
  307.    <build>    
  308.     <defaultGoal/>    
  309.     <resources>    
  310.      <resource>    
  311.       <targetPath/><filtering/><directory/><includes/><excludes/>    
  312.      resource>    
  313.     resources>    
  314.     <testResources>    
  315.      <testResource>    
  316.       <targetPath/><filtering/><directory/><includes/><excludes/>    
  317.      testResource>    
  318.     testResources>    
  319.     <directory/><finalName/><filters/>    
  320.     <pluginManagement>    
  321.      <plugins>    
  322.           
  323.       <plugin>    
  324.        <groupId/><artifactId/><version/><extensions/>    
  325.        <executions>    
  326.         <execution>    
  327.          <id/><phase/><goals/><inherited/><configuration/>    
  328.         execution>    
  329.        executions>    
  330.        <dependencies>    
  331.             
  332.         <dependency>    
  333.          ......    
  334.         dependency>    
  335.        dependencies>    
  336.        <goals/><inherited/><configuration/>    
  337.       plugin>    
  338.      plugins>    
  339.     pluginManagement>    
  340.     <plugins>    
  341.          
  342.      <plugin>    
  343.       <groupId/><artifactId/><version/><extensions/>    
  344.       <executions>    
  345.        <execution>    
  346.         <id/><phase/><goals/><inherited/><configuration/>    
  347.        execution>    
  348.       executions>    
  349.       <dependencies>    
  350.            
  351.        <dependency>    
  352.         ......    
  353.        dependency>    
  354.       dependencies>    
  355.       <goals/><inherited/><configuration/>    
  356.      plugin>    
  357.     plugins>    
  358.    build>    
  359.        
  360.    <modules/>    
  361.        
  362.    <repositories>    
  363.         
  364.     <repository>    
  365.      <releases>    
  366.       <enabled/><updatePolicy/><checksumPolicy/>    
  367.      releases>    
  368.      <snapshots>    
  369.       <enabled/><updatePolicy/><checksumPolicy/>    
  370.      snapshots>    
  371.      <id/><name/><url/><layout/>    
  372.     repository>    
  373.    repositories>    
  374.        
  375.    <pluginRepositories>    
  376.             
  377.     <pluginRepository>    
  378.      <releases>    
  379.       <enabled/><updatePolicy/><checksumPolicy/>    
  380.      releases>    
  381.      <snapshots>    
  382.       <enabled/><updatePolicy/><checksumPolicy/>    
  383.      snapshots>    
  384.      <id/><name/><url/><layout/>    
  385.     pluginRepository>    
  386.    pluginRepositories>    
  387.        
  388.    <dependencies>    
  389.         
  390.     <dependency>    
  391.      ......    
  392.     dependency>    
  393.    dependencies>    
  394.        
  395.    <reports/>       
  396.        
  397.    <reporting>    
  398.     ......    
  399.    reporting>    
  400.        
  401.    <dependencyManagement>    
  402.     <dependencies>    
  403.          
  404.      <dependency>    
  405.       ......    
  406.      dependency>    
  407.     dependencies>    
  408.    dependencyManagement>    
  409.        
  410.    <distributionManagement>    
  411.     ......    
  412.    distributionManagement>    
  413.        
  414.    <properties/>    
  415.   profile>    
  416.  profiles>    
  417.      
  418.  <modules/>    
  419.          
  420.     <repositories>     
  421.          
  422.         <repository>    
  423.              
  424.          <releases>    
  425.               
  426.     <enabled/>    
  427.         
  428.     <updatePolicy/>    
  429.         
  430.     <checksumPolicy/>    
  431.    releases>    
  432.        
  433.    <snapshots>    
  434.     <enabled/><updatePolicy/><checksumPolicy/>    
  435.    snapshots>    
  436.        
  437.    <id>banseon-repository-proxyid>     
  438.        
  439.             <name>banseon-repository-proxyname>     
  440.                 
  441.             <url>http://192.168.1.169:9999/repository/url>     
  442.                 
  443.             <layout>defaultlayout>               
  444.         repository>     
  445.     repositories>    
  446.         
  447.     <pluginRepositories>    
  448.          
  449.   <pluginRepository>    
  450.    ......    
  451.   pluginRepository>    
  452.  pluginRepositories>    
  453.        
  454.          
  455.     <dependencies>     
  456.         <dependency>    
  457.        
  458.             <groupId>org.apache.mavengroupId>     
  459.                 
  460.             <artifactId>maven-artifactartifactId>     
  461.                 
  462.             <version>3.8.1version>     
  463.                 
  464.             <type>jartype>    
  465.                 
  466.             <classifier>classifier>    
  467.                 
  468.             <systemPath>systemPath>     
  469.                 
  470.             <exclusions>    
  471.              <exclusion>     
  472.                     <artifactId>spring-coreartifactId>     
  473.                     <groupId>org.springframeworkgroupId>     
  474.                 exclusion>     
  475.             exclusions>       
  476.                  
  477.             <optional>trueoptional>    
  478.         dependency>    
  479.     dependencies>    
  480.         
  481.     <reports>reports>    
  482.         
  483.  <reporting>    
  484.       
  485.   <excludeDefaults/>    
  486.       
  487.   <outputDirectory/>    
  488.       
  489.   <plugins>    
  490.        
  491.    <plugin>    
  492.         
  493.     <groupId/>    
  494.         
  495.     <artifactId/>    
  496.         
  497.     <version/>    
  498.         
  499.     <inherited/>    
  500.         
  501.     <configuration/>    
  502.         
  503.     <reportSets>    
  504.          
  505.      <reportSet>    
  506.           
  507.       <id/>    
  508.           
  509.       <configuration/>    
  510.           
  511.       <inherited/>    
  512.           
  513.       <reports/>    
  514.      reportSet>    
  515.     reportSets>    
  516.    plugin>    
  517.   plugins>    
  518.  reporting>    
  519.      
  520.  <dependencyManagement>    
  521.   <dependencies>    
  522.        
  523.    <dependency>    
  524.     ......    
  525.    dependency>    
  526.   dependencies>    
  527.  dependencyManagement>       
  528.          
  529.     <distributionManagement>    
  530.             
  531.         <repository>    
  532.              
  533.    <uniqueVersion/>    
  534.    <id>banseon-maven2id>     
  535.    <name>banseon maven2name>     
  536.             <url>file://${basedir}/target/deployurl>     
  537.             <layout/>    
  538.   repository>    
  539.        
  540.   <snapshotRepository>    
  541.    <uniqueVersion/>    
  542.    <id>banseon-maven2id>    
  543.             <name>Banseon-maven2 Snapshot Repositoryname>    
  544.             <url>scp://svn.baidu.com/banseon:/usr/local/maven-snapshoturl>     
  545.    <layout/>    
  546.   snapshotRepository>    
  547.        
  548.         <site>    
  549.               
  550.             <id>banseon-siteid>     
  551.                 
  552.             <name>business api websitename>     
  553.                 
  554.             <url>     
  555.                 scp://svn.baidu.com/banseon:/var/www/localhost/banseon-web      
  556.             url>     
  557.         site>    
  558.       
  559.   <downloadUrl/>    
  560.       
  561.   <relocation>    
  562.        
  563.    <groupId/>    
  564.        
  565.    <artifactId/>    
  566.        
  567.    <version/>    
  568.        
  569.    <message/>    
  570.   relocation>    
  571.       
  572.   <status/>           
  573.     distributionManagement>    
  574.         
  575.     <properties/>    
  576. project>  span>  

你可能感兴趣的:(maven POM.xml 标签详解)