gradle配置备忘

下载:https://gradle.org/install/

下载完成后,配置环境变量

GRADLE_HOME=文件的绝对路径
PATH=拼接%GRADLE_HOME%\bin;

idea中创建自己的gradle项目,settings里配上gradle的路径

image-20210126143803713

build and run 配置不用gradle的,用idea的

bulid.gradle里,参数

allprojects {
    group 'besttest'
    version '1.0.0-SNAPSHOT'
    buildDir = 'target'

    apply plugin: 'idea'
    apply plugin: 'maven'
}

subprojects {
    apply plugin: 'java'

    sourceCompatibility = 1.8
    targetCompatibility = 1.8

    repositories {
        mavenLocal()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        mavenCentral()
    }

    idea {
        module {
            downloadSources = true
            downloadJavadoc = false
            sourceDirs += file('src/main/resources')
        }
    }

    configurations {

    }

    dependencies {
        implementation("com.google.guava:guava:30.1-jre")
        implementation("org.apache.commons:commons-lang3:3.11")
        implementation("com.google.code.gson:gson:2.8.6")
        implementation("org.assertj:assertj-core:3.16.1")
        implementation("org.junit.jupiter:junit-jupiter-api:5.6.2")
        implementation("ch.qos.logback:logback-classic:1.2.3")
        implementation("ch.qos.logback:logback-core:1.2.3")
        implementation("commons-io:commons-io:2.7")
        implementation("cn.hutool:hutool-all:5.4.0")
    }

}
posted on 2021-01-26 14:39  测开小白的杂货铺  阅读(68)  评论(0)    收藏  举报