Spring Cloud alibaba gradle 配置参考

plugins {
    // Apply the java plugin to add support for Java
    id 'java'
    id 'maven'
    // Apply the application plugin to add support for building a CLI application.
    id 'application'
    // spring boot gradle 插件
    id 'org.springframework.boot' version '2.2.7.RELEASE'
    // spring boot gradle 依赖插件
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
}

group 'com.cpicdg'
version '1.0-SNAPSHOT'

sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14

//依赖管理
dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:Greenwich.SR5"
        mavenBom "com.alibaba.cloud:spring-cloud-alibaba-dependencies:2.2.0.RELEASE"
    }
}

repositories {
    // Use jcenter for resolving dependencies.
    // You can declare any Maven/Ivy/file repository here.
    maven{ url 'https://maven.aliyun.com/nexus/content/groups/public'}
    maven{ url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
    maven{ url 'https://repo1.maven.org/maven2/'}
}

dependencies {
    //------spring boot
    //整合web
    compile 'org.springframework.boot:spring-boot-starter-web'
    //整合 aop
    compile 'org.springframework.boot:spring-boot-starter-aop'
    //整合 actuator
    compile 'org.springframework.boot:spring-boot-starter-actuator'
    //整合 jdbc
    compile 'org.springframework.boot:spring-boot-starter-jdbc'
    //spring cloud
    // 整合 feign
    compile 'org.springframework.cloud:spring-cloud-starter-openfeign:2.2.3.RELEASE'


    //--------spring cloud alibaba 依赖
    // nacos 服务中心依赖
    compile 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
    //整合 sentinel
    compile 'com.alibaba.cloud:spring-cloud-starter-alibaba-sentinel'



    //---整合数据库  使用mybatis/beetlsql
    //mysql 驱动
    compile 'mysql:mysql-connector-java:6.0.6'
  
    //beetlsql
    compile 'com.ibeetl:beetl-framework-starter:1.2.31.RELEASE'
    compile 'com.ibeetl:beetlsql:2.12.29.RELEASE'

    //JWT token 工具依赖
    compile 'io.jsonwebtoken:jjwt-api:0.11.1'
    runtime 'io.jsonwebtoken:jjwt-impl:0.11.1'
    runtime 'io.jsonwebtoken:jjwt-jackson:0.11.1'

    //fastjson
    compile 'com.alibaba:fastjson:1.2.68'

    //spring boot test
    testCompile('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
    //junit 5
    testCompile 'org.junit.jupiter:junit-jupiter:5.5.2'
    //lombok
    implementation 'org.projectlombok:lombok:1.18.8'
    annotationProcessor 'org.projectlombok:lombok:1.18.8'
    testCompileOnly 'org.projectlombok:lombok:1.18.8'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.8'

}

tasks.withType(JavaCompile) {
    options.compilerArgs += "--enable-preview"
}
tasks.withType(Test) {
    jvmArgs += "--enable-preview"
}
tasks.withType(JavaExec) {
    jvmArgs += "--enable-preview"
}


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。