搜尋

首頁  >  問答  >  主體

Spring gradle 建構 eclipse,在spring目錄下build.gradle怎麼把國外源換成國內阿里源?

Spring gradle 建置 eclipse,在spring目錄下build.gradle怎麼把國外源換成國內阿里源?

國外源實在是太慢了,想把源換成國內,

如果我換成阿里源就會發生無法找到插件該如何處理呢?

gradle build

伊谢尔伦伊谢尔伦2796 天前793

全部回覆(1)我來回復

  • PHP中文网

    PHP中文网2017-04-24 09:13:54

    不是很了解的你狀況,我先貼一個範例吧,這是我搞Spring boot時用的

    buildscript {
      repositories {
        maven { url "https://repo.spring.io/libs-release" }
        maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
        mavenLocal()
        mavenCentral()
      }
      dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.6.RELEASE")
         classpath "io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE"
      }
    }
    apply plugin: 'java'
    apply plugin: 'maven'
    apply plugin: 'spring-boot'
    apply plugin: "io.spring.dependency-management"
    jar {
        manifest {
            attributes 'Main-Class': 'com.xx.Main'
        }
    }
    group = 'com.xx'
    version = '0.0.1-SNAPSHOT'
    description = """"""
    sourceCompatibility = 1.5
    targetCompatibility = 1.5
    repositories {
            
         maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
    }
    dependencies {
        compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version:'1.3.6.RELEASE'
        compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-rest', version:'1.3.6.RELEASE'
        compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.39'
        compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version:'1.3.6.RELEASE'
        compile group: 'commons-fileupload', name: 'commons-fileupload', version:'1.3.1'
        compile group: 'commons-io', name: 'commons-io', version:'2.3'
        compile group: 'junit', name: 'junit', version:'4.12'
        compile group: 'commons-codec', name: 'commons-codec', version:'1.10'
        compile group: 'net.sf.json-lib', name: 'json-lib', version:'2.4', classifier:'jdk15'
        testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'1.3.6.RELEASE') {
    exclude(module: 'commons-logging')
        }
    }

    回覆
    0
  • 取消回覆