pom作为项目对象模型,通过xml表示maven项目,使用pom.xml文件来实现。


    4.0.0
    
    ... 
    ...  
    ...  
    ...  
    ...
    ...
    ...
    ...
    ...
    
    ...
    ...
    
    ...
    ...
    ...
    ...
    ...
    ...
    ...
    ...
    
    ...
    ...
    ...
    ...
    ...
    ...
    ...
    ...
    ...

pom定义了最小的maven2元素,允许groupId,artifactId,version的所有需要的元素。

pom关系:依赖,集成,合成

依赖关系:

  
      
        junit  
        junit  
        4.0  
        jar  
        test  
        true  
      
    ...  

继承关系

 
    4.0.0 
    org.codehaus.mojo 
    my-parent 
    2.0 
    pom 

合成(或者多个模块)

一个项目有多个模块,也叫做多重模块,或者合成项目。

 
    4.0.0 
    org.codehaus.mojo 
    my-parent 
    2.0 
     
        my-project1 
        my-project2 
     
 

插件

在build时,执行的插件,比较有用的部分,如使用jdk6.0编译等等

 
     
    ... 
     
         
            org.apache.maven.plugins 
            maven-jar-plugin 
            2.0 
            
            false 
            
            true 
            
             
                test 
             
            
            ... 
            
            ...