sofastack / sofa-boot

SOFABoot is a framework that enhances Spring Boot and fully compatible with it, provides readiness check, class isolation, etc.
https://www.sofastack.tech/sofa-boot/docs/Home
Apache License 2.0
4.96k stars 1.26k forks source link

Provide Gradle dependency management plugin #90

Closed khotyn closed 5 years ago

khotyn commented 6 years ago

Spring Boot has a Gradle dependency management plugin to manage the dependencies, maybe SOFABoot should also provide one.

Following is the example of a Spring Boot Gradle build script:

buildscript {
    ext {
        springBootVersion = '2.0.3.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}
primary commented 5 years ago

是的,最好提供一个gradle版本的构建脚本

khotyn commented 5 years ago

🙏,我们近期考虑一下。

-- http://sofastack.tech 2018年12月12日 +0800 PM11:51 primary notifications@github.com,写道:

是的,最好提供一个gradle版本的构建脚本 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

khotyn commented 5 years ago

@primary 我们计划从 3.1.1 开始提供 Gradle 插件,目前在 3.1.1-SNAPSHOT 中可以使用,有兴趣的话,可以试用一下,有问题随时反馈,这里是一个工程的配置样例,文档会在发布的时候提供在 http://sofastack.tech 上:

buildscript {
    ext {
        sofaBootVersion = '3.1.1-SNAPSHOT'
    }
    repositories {
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath("com.alipay.sofa:sofa-boot-gradle-plugin:${sofaBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'com.alipay.sofa.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    implementation('com.alipay.sofa:rpc-sofa-boot-starter')
    implementation('org.springframework.boot:spring-boot-starter')
    testImplementation('org.springframework.boot:spring-boot-starter-test')
}