一个gradle的配置文件

2020-12-04  本文已影响0人  JohnYuCN
buildscript {

    //定义扩展属性(可选)
    ext {
        springBootVersion = "2.3.3.RELEASE"
    }
    repositories {
        mavenLocal()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
        //和maven中央仓库一样的另一个依赖管理仓库,主要是java
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}


allprojects {
    group = 'com.example'
    version = '0.0.1-SNAPSHOT'
}


subprojects {
    apply plugin: 'java'
    apply plugin: 'maven'
    apply plugin: 'org.springframework.boot'  //使用springboot插件
    apply plugin: 'io.spring.dependency-management'  //版本管理插件
    sourceCompatibility = 1.8
    targetCompatibility = 1.8

    tasks.withType(JavaCompile) {
        options.encoding = 'UTF-8'
    }

    repositories {
        mavenLocal()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
        //和maven中央仓库一样的另一个依赖管理仓库,主要是java
        jcenter()
    }
    dependencies {
        testCompile group: 'junit', name: 'junit', version: '4.12'
        implementation 'org.springframework.boot:spring-boot-devtools'
        testImplementation 'org.springframework.boot:spring-boot-starter-test'
    }
}

上一篇下一篇

猜你喜欢

热点阅读