# 灵铱公司－会员订单项目配置

```groovy
buildscript {

    ext {

        springBootVersion = '1.5.7.RELEASE'

    }

    repositories {

        mavenCentral()

    }

    dependencies {

        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }

}


//环境配置
ext.profile = System.getProperty("profile") == null ? "dev" : System.getProperty("profile")
def loadProperties(){   

        def props = new Properties()

        new File("${rootProject.projectDir}/env/${project.profile}.properties").withInputStream { 

             stream -> props.load(stream)          
          }   

        props

}


allprojects {

    apply plugin: 'eclipse'
    apply plugin: 'maven'
    apply plugin: 'java'





    group = 'net.ly'

    version = '0.0.1-SNAPSHOT'

    sourceCompatibility = 1.8
    targetCompatibility = 1.8



    [compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'




}


subprojects {

    repositories {

        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}

        mavenCentral()
    }

    ext {
          cicadaFilesystemVersion = '1.+'
          cicadaUserdriverVersion = '1.+'
          cicadaMybatisVersion = '1.+'
          cicadaWebVersion = '1.+'
          cicadaDepartdriverVersion = '1.+'
          cicadaAthorizationVersion = '1.0.0.7'
          mybatisGeneratorCoreVersion = '1.3.2'
          commonsLang3Version = '3.5'
          commonsBeanutilsVersion = '1.9.3'
          zxingCoreVersion = '3.3.0'
          zxingJavaseVersion = '3.3.0'
          fastjsonVersion = '1.2.33'
          springRabbitVersion = '1.7.3.RELEASE'
          quartzVersion = '2.3.0'
          springContextSupportVersion = '4.3.9.RELEASE'
          validationApiVersion = '1.1.0.Final'
          hibernateValidatorVersion = '5.2.0.Final'
          mysqlConnectorJavaVersion = '5.1.38'
          commonsPool2Version = '2.4.2'
          jedisVersion = '2.7.3'
    }


    configurations.all {

        resolutionStrategy {

            force "mysql:mysql-connector-java:${mysqlConnectorJavaVersion}"

        }
    }








}

project(':api') {

    apply plugin: 'war'

    dependencies {

        compile(

             project(':common'), 

            "net.oschina.zcx7878:cicada.filesystem:${cicadaFilesystemVersion}",
            "net.oschina.zcx7878:cicada.authorization:${cicadaAthorizationVersion}",
            "net.oschina.zcx7878:cicada.web:${cicadaWebVersion}",
            "com.google.zxing:core:${zxingCoreVersion}",
            "com.google.zxing:javase:${zxingJavaseVersion}",
            "org.springframework.amqp:spring-rabbit:${springRabbitVersion}",
            "org.springframework:spring-context-support:${springContextSupportVersion}",
            "javax.validation:validation-api:${validationApiVersion}",
            "org.hibernate:hibernate-validator:${hibernateValidatorVersion}",
            "org.apache.commons:commons-pool2:${commonsPool2Version}",
            "redis.clients:jedis:${jedisVersion}",

        )

    }




}




project(':common'){



    dependencies{

        compile(

            "net.oschina.zcx7878:cicada.userdriver:${cicadaUserdriverVersion}",
            "net.oschina.zcx7878:cicada.departdriver:${cicadaDepartdriverVersion}",
            "net.oschina.zcx7878:cicada.mybatis:${cicadaMybatisVersion}",
            "org.apache.commons:commons-lang3:${commonsLang3Version}",
            "commons-beanutils:commons-beanutils:${commonsBeanutilsVersion}",
            "org.mybatis.generator:mybatis-generator-core:${mybatisGeneratorCoreVersion}",
            "com.alibaba:fastjson:${fastjsonVersion}",
        )

    }

}





project(':mq'){



    apply plugin: 'org.springframework.boot'


    springBoot {

        executable = true
    }

    dependencies {

        compile(

            project(':common'),    
            'org.springframework.boot:spring-boot-starter-amqp'        
        ) 

    }



    //属性替换
    processResources {    

        from(sourceSets.main.resources.srcDirs) {   

            println "当前配置环境profile:${project.profile}，开始环境配置"    

             filter(org.apache.tools.ant.filters.ReplaceTokens,tokens: loadProperties())   

             println "环境配置完成"  
         }

    }





}


project(':timer'){


    apply plugin: 'org.springframework.boot'


    springBoot {

        executable = true
    }



    dependencies{

        compile(
            project(':common'),    
            "org.springframework:spring-context-support:${springContextSupportVersion}",
            "org.quartz-scheduler:quartz:${quartzVersion}",
            "org.springframework.boot:spring-boot-starter",
        )

    }





}
```
