Java 基础
  • Introduction
  • 工具类
    • 日期
  • 枚举
  • 多线程
    • java中多线程实现的3种方式
    • ThreadPoolExecutor线程池参数设置技巧
  • Java Stream API 入门篇
  • gradle项目构建工具
    • gradle使用总结
      • eclipse中指定gradle的java home
      • gradle 跨工程引用
      • Gradle 引入本地定制 jar 包
      • gradle构建脚本基础
      • maven-publish plugin
      • 灵铱公司-会员订单项目配置
      • ssh plugin
  • json
    • gson
      • gson使用指南
  • 并发编程
    • Lock
    • Condition
    • Semaphore对象池-令牌桶
    • 读多写少·读写互斥·本地缓存
    • 线程池线程任务执行完成计数器
    • 线程池使用
  • Google Guava官方教程
    • Guave Cache
Powered by GitBook
On this page

Was this helpful?

  1. gradle项目构建工具
  2. gradle使用总结

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

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",
        )

    }





}
Previousmaven-publish pluginNextssh plugin

Last updated 6 years ago

Was this helpful?