<Maven>pom.xml的相关配置

pom.xml有如下几个配置

(1)项目基础信息配置
(2)项目构建环境配置
(3)项目仓库管理配置
(4)项目依赖管理配置
(5)项目报表信息配置
(6)项目部署分发配置

总的配置如下

各配置中主要关注的为

(1)项目基础信息配置

没什么太需要关注的,就是一些基础信息,根据需求写即可

(2)项目构建环境配置

modules

resources

filters

pluginManagerment

profiles

(3)项目仓库管理配置

repositories

(4)项目依赖管理配置

dependencyManagement
dependencies

(5)项目报表信息配置

properties

(6)项目部署分发配置

用的比较少

如下配置信息比较长,建议复制到本地有需要的话查看即可

<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">  
    
      
    <parent>  
          
        <artifactId />  
          
        <groupId />  
          
        <version />  
          
        <relativePath />  
    parent>  
      
    <modelVersion>4.0.0modelVersion>  
      
    <groupId>asia.banseongroupId>  
      
    <artifactId>banseon-maven2artifactId>  
      
    <packaging>jarpackaging>  
      
    <version>1.0-SNAPSHOTversion>  
      
    <name>banseon-mavenname>  
      
    <url>http://www.baidu.com/banseonurl>  
      
    <description>A maven project to study maven.description> 
      
    <inceptionYear />  
      
    <mailingLists>  
          
        <mailingList>  
              
            <name>Demoname>  
              
            <post>[email protected]post>  
              
            <subscribe>[email protected]subscribe>  
              
            <unsubscribe>[email protected]unsubscribe>  
              
            <archive>http://localhost:8080/demo/dev/archive>  
        mailingList>  
    mailingLists>  
      
    <developers>  
          
        <developer>  
              
            <id>HELLO WORLDid>  
              
            <name>younamename>  
              
            <email>[email protected]email>  
              
            <url />  
              
            <roles>  
                <role>Project Managerrole>  
                <role>Architectrole>  
            roles>  
              
            <organization>demoorganization>  
              
            <organizationUrl>http://www.xxx.com/organizationUrl>  
              
            <properties>  
                <dept>Nodept>  
            properties>  
              
            <timezone>+8timezone>  
        developer>  
    developers>  
      
    <contributors>  
          
        <contributor>  
            <name />  
            <email />  
            <url />  
            <organization />  
            <organizationUrl />  
            <roles />  
            <timezone />  
            <properties />  
        contributor>  
    contributors>  
      
    <licenses>  
          
        <license>  
              
            <name>Apache 2name>  
              
            <url>http://www.xxxx.com/LICENSE-2.0.txturl>  
              
            <distribution>repodistribution>  
              
            <comments>A business-friendly OSS licensecomments>  
        license>  
    licenses>  
      
    <scm>  
          
        <connection>  
            scm:svn:http://svn.xxxx.com/maven/xxxxx-maven2-trunk(dao-trunk)     
        connection>  
          
        <developerConnection>  
            scm:svn:http://svn.xxxx.com/maven/dao-trunk     
        developerConnection>  
          
        <tag />  
          
        <url>http://svn.xxxxx.com/url>  
    scm>  
      
    <organization>  
          
        <name>demoname>  
          
        <url>http://www.xxxxxx.com/url>  
    organization>  



    
      
    <prerequisites>  
          
        <maven />  
    prerequisites>  
      
    <issueManagement>  
          
        <system>jirasystem>  
          
        <url>http://jira.xxxx.com/xxxxurl>  
    issueManagement>  
      
    <ciManagement>  
          
        <system />  
          
        <url />  
          
        <notifiers>  
              
            <notifier>  
                  
                <type />  
                  
                <sendOnError />  
                  
                <sendOnFailure />  
                  
                <sendOnSuccess />  
                  
                <sendOnWarning />  
                  
                <address />  
                  
                <configuration />  
            notifier>  
        notifiers>  
    ciManagement>  
      
    <modules />  
     
    <build>  
          
        <sourceDirectory />  
          
        <scriptSourceDirectory />  
          
        <testSourceDirectory />  
          
        <outputDirectory />  
          
        <testOutputDirectory />  
          
        <extensions>  
              
            <extension>  
                  
                <groupId />  
                  
                <artifactId />  
                  
                <version />  
            extension>  
        extensions>  
          
        <defaultGoal />  
          
        <resources>  
              
            <resource>  
                  
                <targetPath />  
                  
                <filtering />  
                  
                <directory />  
                  
                <includes />  
                  
                <excludes />  
            resource>  
        resources>  
          
        <testResources>  
              
            <testResource>  
                <targetPath />  
                <filtering />  
                <directory />  
                <includes />  
                <excludes />  
            testResource>  
        testResources>  
          
        <directory />  
          
        <finalName />  
          
        <filters />  
          
        <pluginManagement>  
              
            <plugins>  
                  
                <plugin>  
                      
                    <groupId />  
                      
                    <artifactId />  
                      
                    <version />  
                      
                    <extensions />  
                      
                    <executions>  
                          
                        <execution>  
                              
                            <id />  
                              
                            <phase />  
                              
                            <goals />  
                              
                            <inherited />  
                              
                            <configuration />  
                        execution>  
                    executions>  
                      
                    <dependencies>  
                          
                        <dependency>......dependency>  
                    dependencies>  
                      
                    <inherited />  
                      
                    <configuration />  
                plugin>  
            plugins>  
        pluginManagement>  
          
        <plugins>  
              
            <plugin>  
                <groupId />  
                <artifactId />  
                <version />  
                <extensions />  
                <executions>  
                    <execution>  
                        <id />  
                        <phase />  
                        <goals />  
                        <inherited />  
                        <configuration />  
                    execution>  
                executions>  
                <dependencies>  
                      
                    <dependency>......dependency>  
                dependencies>  
                <goals />  
                <inherited />  
                <configuration />  
            plugin>  
        plugins>  
    build>  
      
    <profiles>  
          
        <profile>  
              
            <id />  
              
            <activation>  
                  
                <activeByDefault />  
                  
                <jdk />  
                  
                <os>  
                      
                    <name>Windows XPname>  
                      
                    <family>Windowsfamily>  
                      
                    <arch>x64arch>  
                      
                    <version>6.1.7100version>  
                os>  
                  
                <property>  
                      
                    <name>mavenVersionname>  
                      
                    <value>2.0.3value>  
                property>  
                  
                <file>  
                      
                    <exists>/usr/local/xxxx/xxxx-home/tomcat/maven-guide-zh-to-production/workspace/  
                    exists>  
                      
                    <missing>/usr/local/xxxx/xxxx-home/tomcat/maven-guide-zh-to-production/workspace/  
                    missing>  
                file>  
            activation>  
              
            <build>  
                <defaultGoal />  
                <resources>  
                    <resource>  
                        <targetPath />  
                        <filtering />  
                        <directory />  
                        <includes />  
                        <excludes />  
                    resource>  
                resources>  
                <testResources>  
                    <testResource>  
                        <targetPath />  
                        <filtering />  
                        <directory />  
                        <includes />  
                        <excludes />  
                    testResource>  
                testResources>  
                <directory />  
                <finalName />  
                <filters />  
                <pluginManagement>  
                    <plugins>  
                          
                        <plugin>  
                            <groupId />  
                            <artifactId />  
                            <version />  
                            <extensions />  
                            <executions>  
                                <execution>  
                                    <id />  
                                    <phase />  
                                    <goals />  
                                    <inherited />  
                                    <configuration />  
                                execution>  
                            executions>  
                            <dependencies>  
                                  
                                <dependency>......dependency>  
                            dependencies>  
                            <goals />  
                            <inherited />  
                            <configuration />  
                        plugin>  
                    plugins>  
                pluginManagement>  
                <plugins>  
                      
                    <plugin>  
                        <groupId />  
                        <artifactId />  
                        <version />  
                        <extensions />  
                        <executions>  
                            <execution>  
                                <id />  
                                <phase />  
                                <goals />  
                                <inherited />  
                                <configuration />  
                            execution>  
                        executions>  
                        <dependencies>  
                              
                            <dependency>......dependency>  
                        dependencies>  
                        <goals />  
                        <inherited />  
                        <configuration />  
                    plugin>  
                plugins>  
            build>  
              
            <modules />  
              
            <repositories>  
                  
                <repository>  
                    <releases>  
                        <enabled />  
                        <updatePolicy />  
                        <checksumPolicy />  
                    releases>  
                    <snapshots>  
                        <enabled />  
                        <updatePolicy />  
                        <checksumPolicy />  
                    snapshots>  
                    <id />  
                    <name />  
                    <url />  
                    <layout />  
                repository>  
            repositories>  
              
            <pluginRepositories>  
                  
                <pluginRepository>  
                    <releases>  
                        <enabled />  
                        <updatePolicy />  
                        <checksumPolicy />  
                    releases>  
                    <snapshots>  
                        <enabled />  
                        <updatePolicy />  
                        <checksumPolicy />  
                    snapshots>  
                    <id />  
                    <name />  
                    <url />  
                    <layout />  
                pluginRepository>  
            pluginRepositories>  
              
            <dependencies>  
                  
                <dependency>......dependency>  
            dependencies>  
              
            <reports />  
              
            <reporting>......reporting>  
              
            <dependencyManagement>  
                <dependencies>  
                      
                    <dependency>......dependency>  
                dependencies>  
            dependencyManagement>  
              
            <distributionManagement>......distributionManagement>  
              
            <properties />  
        profile>  
    profiles>  
    

    
      
    <repositories>  
          
        <repository>  
              
            <releases>  
                  
                <enabled />  
                  
                <updatePolicy />  
                  
                <checksumPolicy />  
            releases>  
              
            <snapshots>  
                <enabled />  
                <updatePolicy />  
                <checksumPolicy />  
            snapshots>  
              
            <id>banseon-repository-proxyid>  
              
            <name>banseon-repository-proxyname>  
              
            <url>http://10.10.10.123:8080/repository/url>  
              
            <layout>defaultlayout>  
        repository>  
    repositories>  

      
    <pluginRepositories>  
          
        <pluginRepository>......pluginRepository>  
    pluginRepositories>  
  
    
      
    <dependencyManagement>  
        <dependencies>  
              
            <dependency>......dependency>  
        dependencies>  
    dependencyManagement>
      
    <dependencies>  
        <dependency>  
              
            <groupId>org.apache.mavengroupId>  
              
            <artifactId>maven-artifactartifactId>  
              
            <version>3.8.1version>  
              
            <type>jartype>  
              
            <classifier>classifier>  
              
            <scope>testscope>  
              
            <systemPath>systemPath>  
              
            <exclusions>  
                <exclusion>  
                    <artifactId>spring-coreartifactId>  
                    <groupId>org.springframeworkgroupId>  
                exclusion>  
            exclusions>  
              
            <optional>trueoptional>  
        dependency>  
    dependencies>  

    
      
    <properties />  
      
    <reports>reports>  
      
    <reporting>  
          
        <excludeDefaults />  
          
        <outputDirectory />  
          
        <plugins>  
              
            <plugin>  
                  
                <groupId />  
                  
                <artifactId />  
                  
                <version />  
                  
                <inherited />  
                  
                <configuration />  
                  
                <reportSets>  
                      
                    <reportSet>  
                          
                        <id />  
                          
                        <configuration />  
                          
                        <inherited />  
                          
                        <reports />  
                    reportSet>  
                reportSets>  
            plugin>  
        plugins>  
    reporting>  

    
      
      
    <distributionManagement>  
          
        <repository>  
              
            <uniqueVersion />  
            <id>xxx-maven2id>  
            <name>xxx maven2name>  
            <url>file://${basedir}/target/deployurl>  
            <layout />  
        repository>  
          
        <snapshotRepository>  
            <uniqueVersion />  
            <id>xxx-maven2id>  
            <name>xxx-maven2 Snapshot Repositoryname>  
            <url>scp://svn.xxxx.com/xxx:/usr/local/maven-snapshoturl>  
            <layout />  
        snapshotRepository>  
          
        <site>  
              
            <id>banseon-siteid>  
              
            <name>business api websitename>  
              
            <url>  
                scp://svn.baidu.com/xxx:/var/www/localhost/web     
            url>  
        site>  
          
        <downloadUrl />  
          
        <relocation>  
              
            <groupId />  
              
            <artifactId />  
              
            <version />  
              
            <message />  
        relocation>  
          
        <status />  
    distributionManagement>  
    
project>   

你可能感兴趣的:(Maven,maven)