zoukankan      html  css  js  c++  java
  • 【Gradle】-NO.101.Gradle.1.gradle.1.001-【Gradle Configuration】-(

    Style:Gradle

    Series:Gradle

    Since:2018-09-20

    End:2018-09-20

    Total Hours:1

    Degree Of Diffculty:5

    Degree Of Mastery:5

    Practical Level:5

    Desired Goal:5

    Archieve Goal:3

    Gerneral Evaluation:3

    Writer:kingdelee

    Related Links:

    http://www.cnblogs.com/kingdelee/

     https://blog.csdn.net/tianqishu11/article/details/78798264

    1.

    vim ~/.bash_profile 最好修改的是 /etc/profile

    source ~/.bash_profile

    export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
    export JAVA_10_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home
    
    export GRADLE_HOME=${HOME}/Library/gradle/gradle-4.10.2
    exprot GRADLE_USER_HOME=${HOME}/workstation/gradle/.gradle
    
    
    
    alias jdk8="export JAVA_HOME=$JAVA_8_HOME"
    alias jdk10="export JAVA_HOME=$JAVA_10_HOME"
    
    export JAVA_HOME=$JAVA_8_HOME
    
    PATH="${PATH}:${JAVA_HOME}:${GRADLE_HOME}/bin"
    export PATH
    

    2.

    在库目录下,创建init.gradle文件,编辑以下内容,并执行gradle build

    allprojects{
        repositories {
            def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
            all { ArtifactRepository repo ->
                def url = repo.url.toString()
                if ((repo instanceof MavenArtifactRepository) && (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com'))) {
                    project.logger.lifecycle 'Repository ${repo.url} replaced by $REPOSITORY_URL .'
                    remove repo
                }
            }
            maven {
                url REPOSITORY_URL
            }
        }
    }  

     把项目中的build.gradle的此处修改

    allprojects {
        repositories {
            maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        }
    }
    

      

  • 相关阅读:
    Ubuntu 配置IP地址方法
    ubuntu server 16.04安装GPU服务器
    Ubuntu 自动获取ip地址
    Typedef 用法
    linux mount命令详解(iso文件挂载)
    specrate 与specspeed 的区别
    SPEC CPU 使用简介
    编译错误you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
    SPEC CPU 2006编译perl 出错:undefined reference to `pow'
    'gets' undeclared here (not in a function)
  • 原文地址:https://www.cnblogs.com/kingdelee/p/9688341.html
Copyright © 2011-2022 走看看