Maven 之pom 文件详解


<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">
    <modelVersion>4.0.0modelVersion>

    <groupId>haitun-reportgroupId>
    <artifactId>haitun-reportartifactId>
    <version>1.0.0version>
    <name>haitun-reportname>
    
    <packaging>pompackaging>

    
    <modules>
        <module>haitun-report-servermodule>
        <module>haitun-report-servicemodule>
        <module>haitun-report-workermodule>
    modules>

    
    <parent>
        <groupId>com.javxuan.bootgroupId>
        <artifactId>my-bootartifactId>
        <version>1.3.5.RELEASEversion>
        
        <relativePath>../pom.xmlrelativePath>
    parent>

    
    <properties>
        <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
        <java.version>1.8java.version>
        <spring.version>4.2.7.RELEASEspring.version>
    properties>

    
    <dependencyManagement>
        <dependencies>
           <dependency>
               <groupId>junitgroupId>
               <artifactId>junitartifactId>
               <version>4.12version>
               <scope>testscope>
           dependency>
       dependencies>
    dependencyManagement>

    
    <dependencies>
        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-webartifactId>
        dependency>
    dependencies>

    
    <profiles>
       <profile>
           <id>devid>
           <activation>
               <activeByDefault>trueactiveByDefault>
           activation>
           <properties>
               <evn>devevn>
           properties>
           <build>
               <filters>
                   <filter>src/main/resources/application-dev.ymlfilter>
               filters>
           build>
       profile>

       <profile>
           <id>testid>
           <properties>
               <evn>testevn>
           properties>
           <build>
               <filters>
                   <filter>src/main/resources/application-test.ymlfilter>
               filters>
           build>
       profile>

       <profile>
           <id>betaid>
           <properties>
               <evn>betaevn>
           properties>
           <build>
               <filters>
                   <filter>src/main/resources/application-beta.ymlfilter>
               filters>
           build>
       profile>

       <profile>
           <id>prodid>
           <properties>
               <evn>prodevn>
           properties>
           <build>
               <filters>
                   <filter>src/main/resources/application-prod.ymlfilter>
               filters>
           build>
       profile>
  profiles>

    
    <build>
        
        <resources>
            <resource>
                <directory>src/main/resourcesdirectory>
                <filtering>truefiltering>
            resource>
        resources>
        
       <plugins>
            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
                <executions>
                    <execution>
                      <goals>
                        <goal>repackagegoal>
                      goals>
                    execution>
                 executions>
            plugin>

        plugins>
        <defaultGoal>compiledefaultGoal>
    build>


project>

你可能感兴趣的:(工具系列,maven的pom文件,profiles,properties,打包方式)