Spring gradle 构建 eclipse,在spring目录下build.gradle怎么把国外源换成国内阿里源呢?

 用户gokk5efqd3 发布于 2022-10-26 15:31

Spring gradle 构建 eclipse,在spring目录下build.gradle怎么把国外源换成国内阿里源呢?

国外源实在是太慢了,想把源换成国内,

如果我换成阿里源就会发生无法找到插件该如何处理呢?

gradle build

1 个回答
  • 不是很了解的你情况,我先贴一个示例吧,这是我搞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')
        }
    }
    2022-10-27 00:58 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有