Gradle構建springboot專案的倉庫處理(包括外掛倉庫以及依賴倉庫)

sjs_caomei發表於2020-06-29

外掛查庫:

settings.gradle中的程式碼:

pluginManagement {
    repositories {
        maven {
            url 'https://maven.aliyun.com/repository/gradle-plugin'
        }
    }
}
rootProject.name = 'demo'
// settings.gradle

依賴倉庫:

build.gradle中的程式碼:

plugins {
    id 'org.springframework.boot' version '2.3.0.RELEASE'
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
    id 'java'
}

group = 'cn.sjsmile'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
//    mavenCentral()
      maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
      maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
      maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}

}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

test {
    useJUnitPlatform()
}

 

相關文章