Maven使用心得 -- 常用setting.xml和pom.xml配置

使用Maven一段时间了,整理了下,为了可重用的未来

Parent Pom.xml  http://maven.apache.org/pom.html


  
    
      
      1.0.0
  
  4.0.0
  
  
  pom
  
  Parent POM
  http://maven.apache.org

  
    3.0
  
  
  
  

  
    
    1.6
    UTF-8
    UTF-8
    
    
     

    
    
    
    2.4
    2.3
    -->
    
    
    
    
  

 
     scm:git:${git.repository.root}/***
     scm:git:${git.repository.root}/***
    scm:git:scm:git:${git.repository.root}/***
  
 
  
    
  

  
    
      
      
        junit
        junit
        ${project.junitVersion}
        test
      
      
        org.mockito
        mockito-all
        ${project.mockito-allVersion}
        test
        true
      
      
      
        javaee
        javaee-api
        ${project.jeeVersion}
        provided
      
      
     ......
    
  

  
    
      
         
         
          org.apache.maven.plugins
          maven-compiler-plugin
          
            ${project.build.sourceEncoding}
            ${compileSource}
            ${compileSource}
          
        
        
          org.apache.maven.plugins
          maven-javadoc-plugin
          ${project.javadocPluginVersion}
          
            
              attach-javadocs
              
                jar
              
            
          
        
        
          org.apache.maven.plugins
          maven-eclipse-plugin
          ${project.eclipsePluginVersion}
          
           
           
           
           [artifactId]-[version]
           true
           false
           false
           true
           ${project.wtpVersion}
           
             
              
                de.mvmsoft.checkclipse.CheckclipseBuilder
              
            
           
           
            
              de.mvmsoft.checkclipse.CheckclipseNature
            
           
           
            
              .checkclipse
              
                enabled=true
projectclassloader=false
              
            
           
         
         
          
            clean
            clean
            
              clean
            
          
          
            generate-resources
            generate-resources
            
              eclipse
            
          
         
        
        
          org.apache.maven.plugins
          maven-project-info-reports-plugin
          ${project.projectInfoReportsPluginVersion}
        
        
          org.apache.maven.plugins
          maven-site-plugin
          ${project.sitePluginVersion}
          
          
            ${project.sitePluginSkip}
          
               
        
          org.apache.maven.plugins
          maven-dependency-plugin
          ${project.dependencyPluginVersion}
        
        
          org.codehaus.mojo
          versions-maven-plugin
          ${project.versionsPluginVersion}
        
        
        org.apache.maven.plugins
        maven-release-plugin
        
          true
          clean javadoc:jar install
          target,release              
        
      
        
        
          org.apache.maven.plugins
          maven-ejb-plugin
          ${project.ejbPluginVersion}
          
            ${project.ejbVersion}
          
        
        
          org.apache.maven.plugins
          maven-war-plugin
          ${project.warPluginVersion}
          
            false
          
         
      
    
    
    
    
     
        org.apache.maven.plugins
        maven-release-plugin
       
    
  

  
    
       
        org.apache.maven.plugins
        maven-surefire-report-plugin
        
        ${project.surefireReportPluginVersion}
        
          false
        
      
      
        org.codehaus.mojo
        cobertura-maven-plugin
        ${project.coberturaPluginVersion}
        
          
            html
            xml
          
        
       
      
        org.apache.maven.plugins
        maven-checkstyle-plugin
        ${project.checkstylePluginVersion}
      
      
        org.apache.maven.plugins
        maven-jxr-plugin
        ${project.jxrPluginVersion}
      
      
        org.apache.maven.plugins
        maven-pmd-plugin
        ${project.pmdPluginVersion}
        
          true
          ${compileSource}
        
      
      
        org.codehaus.mojo
        findbugs-maven-plugin
        ${project.findbugsPluginVersion}
        
          true
          Default
          Normal
        
      
      
        org.codehaus.sonar-plugins
        maven-report
        ${project.sonarPluginVersion}
      
    
      org.codehaus.mojo
      versions-maven-plugin
      ${project.versionsPluginVersion}
      
        
          
            dependency-updates-report
            plugin-updates-report
            property-updates-report
          
        
      
    
  
  


  
    
  

  
    
  


后续还要加入一些其他插件的支持,比如failsafe,慢慢完善它


Setting.xml http://maven.apache.org/settings.html



  
  ${user.home}/.m2/repository

  
  false
  
  
  false
  
  
    
  
  
  
    
     
    
  

  
    
  

  
    
      repos
      
        true
         
                
        
      
      
        
        
     
     
   
   
  
    repos
  




你可能感兴趣的:(JEE,Java)