zoukankan      html  css  js  c++  java
  • maven的profile 目录、变量打包

    <project>
    
     <build>
        <finalName>maven-project</finalName>
        <resources>  
           <resource>  
               <directory>src/main/resources</directory>
                <!--资源根目录排除各环境的配置,使用单独的资源目录来指定   -->
               <excludes>
                   <exclude>dev/*</exclude>
                   <exclude>prd/*</exclude>
               </excludes>
              <filtering>true</filtering>
           </resource>
           <resource>
               <directory>src/main/resources</directory>           
                <!-- 包含,若没有指定则默认为 activeByDefault 标签定义的profile -->  
                <includes>  
                    <include>${profiles.active}/*</include>  
                </includes>  
               <filtering>true</filtering>
           </resource>
        </resources>  
      </build>
      
        <profiles>
            <profile>
                <!-- 本地开发环境 -->
                <id>dev</id>
                <properties>
                    <profiles.active>dev</profiles.active>
                       <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
                    <jdbc.url>jdbc:mysql://localhost:3306/dev</jdbc.url>
                    <jdbc.username>root_dev</jdbc.username>
                    <jdbc.password>123456_dev</jdbc.password>
                    <jdbc.maxActive>5</jdbc.maxActive>
                    <deploy.url>http://host:port/manager/text</deploy.url>
                </properties>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
            </profile>
            <profile>
                <!-- 生产环境 -->
                <id>prd</id>
                <properties>
                    <profiles.active>prd</profiles.active>
                       <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
                    <jdbc.url>jdbc:mysql://localhost:3306/prd</jdbc.url>
                    <jdbc.username>root_prd</jdbc.username>
                    <jdbc.password>123456_prd</jdbc.password>
                    <jdbc.maxActive>5</jdbc.maxActive>
                    <deploy.url>http://host:port/manager/text</deploy.url>
                </properties>
            </profile>
        </profiles>
    </project>

    jdbc.properties

    jdbc.driver=${jdbc.driver}
    jdbc.url=${jdbc.url}
    jdbc.username=${jdbc.username}
    jdbc.password=${jdbc.password}
    jdbc.maxActive=${jdbc.maxActive}

  • 相关阅读:
    ERP Odoo开发--Getting started with Odoo development --openerp
    5 Tips for Building a Winning DevOps Culture
    android stream media
    LDAP summary-- Python ldap
    android call and audio
    android bluetooth
    .windows安装使用这些偏底层的Python扩展太
    经典的DOS小命令 for 网络 nbtstat
    js和jquery设置disabled属性为true使按钮失效
    Several ports (8005, 8080, 8009)被占用
  • 原文地址:https://www.cnblogs.com/web369/p/7515978.html
Copyright © 2011-2022 走看看