以下是我在练习中使用的一个 Spring-Boot 的 build.gradle 文件,通过网络上搜索得到的一个比较全面的配置。

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

buildscript {
    ext {
        springBootVersion = '1.5.2.RELEASE'
        jacksonVersion = '2.8.5'
    }
    repositories {
        // NOTE: You should declare only repositories that you need here
        mavenLocal()
        mavenCentral()
        maven { url "http://repo.spring.io/release" }
        maven { url "http://repo.spring.io/milestone" }
        maven { url "http://repo.spring.io/snapshot" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

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

apply plugin: 'java'
apply plugin: 'spring-boot'

sourceCompatibility = 1.8

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jacksonVersion}"
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jacksonVersion}"
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "${jacksonVersion}"
    compile group: 'org.hashids', name: 'hashids', version: '1.0.1'

    compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: "${springBootVersion}"
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "${springBootVersion}"
    compile group: 'org.projectlombok', name: 'lombok', version: '1.16.14'
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
    compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
    compile group: 'com.google.guava', name: 'guava', version: '21.0'
    compile group: 'joda-time', name: 'joda-time', version: '2.9.7'
    compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.41'
}
GitHub 加速计划 / sp / spring-boot
73.97 K
40.4 K
下载
spring-projects/spring-boot: 是一个用于简化Spring应用开发的框架。适合用于需要快速开发企业级Java应用的项目。特点是可以提供自动配置、独立运行和内置的Tomcat服务器,简化Spring应用的构建和部署。
最近提交(Master分支:1 个月前 )
fdf24c6c Closes gh-42976 5 天前
3c42ba8c * pr/42974: Fix copyright year of updated file Polish Closes gh-42974 5 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐