zoukankan      html  css  js  c++  java
  • gradle配置maven仓库

    Maven配置

    • 在gradle(kts)中配置maven:

      build.gradle.kts

    //仓库配置
    repositories {
        //mavenLocal { setUrl("file://${project.rootDir}/lib") }
        //首先去本地仓库找
        mavenLocal()
        //然后去阿里仓库找
        // build.gradle:
        // maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
    
        // build.gradle.kts:
        maven { url = uri("https://repo.spring.io/release") }
        maven {
            isAllowInsecureProtocol = true
            setUrl("http://maven.aliyun.com/nexus/content/groups/public/")
        }
        maven {
            isAllowInsecureProtocol = true
            url = uri("https://maven.aliyun.com/repository/public") }
        maven {
            isAllowInsecureProtocol = true
            url = uri("https://maven.aliyun.com/repository/google") }
        maven {
            isAllowInsecureProtocol = true
            url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
        maven {
            isAllowInsecureProtocol = true
            url = uri("https://maven.aliyun.com/repository/spring-plugin") }
        maven {
            isAllowInsecureProtocol = true
            url = uri("https://maven.aliyun.com/repository/apache-snapshots") }
        maven {
            isAllowInsecureProtocol = true
            url = uri("http://oss.jfrog.org/artifactory/oss-snapshot-local/") }
        google()
        jcenter()
        //最后从maven中央仓库找
        mavenCentral()
    }
    
    • 在gradle(groovy)中配置maven:

      build.gradle

    //仓库配置
    repositories {
        //mavenLocal { setUrl("file://${project.rootDir}/lib") }
        //首先去本地仓库找
        mavenLocal()
        //然后去阿里仓库找
        // build.gradle.kts:
        //maven {
        //    isAllowInsecureProtocol = true
        //    setUrl("http://maven.aliyun.com/nexus/content/groups/public/")
        //}
    
        // build.gradle:
        maven { 
            setAllowInsecureProtocol(true)
            url "https://repo.spring.io/release" 
        }
        maven {
            //isAllowInsecureProtocol = true
            setAllowInsecureProtocol(true)
            url "http://maven.aliyun.com/nexus/content/groups/public/"
        }
        maven {
            //isAllowInsecureProtocol = true
            setAllowInsecureProtocol(true)
            url "https://maven.aliyun.com/repository/public"
        }
        maven {
            //isAllowInsecureProtocol = true
            setAllowInsecureProtocol(true)
            url "https://maven.aliyun.com/repository/google" }
        maven {
            //isAllowInsecureProtocol = true
            setAllowInsecureProtocol(true)
            url "https://maven.aliyun.com/repository/gradle-plugin" }
        maven {
            //isAllowInsecureProtocol = true
            setAllowInsecureProtocol(true)
            url "https://maven.aliyun.com/repository/spring-plugin" }
        maven {
            //isAllowInsecureProtocol = true
            setAllowInsecureProtocol(true)
            url "https://maven.aliyun.com/repository/apache-snapshots" }
        maven {
            //isAllowInsecureProtocol = true
            setAllowInsecureProtocol(true)
            url "http://oss.jfrog.org/artifactory/oss-snapshot-local/" }
        google()
        jcenter()
        //最后从maven中央仓库找
        mavenCentral()
    }
    

    IDEA配置代码模板

    1. 打开配置(settigs/preference)

    2. 搜索live(找到live template)

    3. 找到kotlin、gradle,分别做如下配置
      maven代码模板

    4. 配置完毕后,在编辑器中输入“mreps”,弹出提示,回车(Enter)。
      使用示例

  • 相关阅读:
    Pycharm快捷键
    unittest自动化测试框架
    Python简介
    Git工作流介绍
    GitFlow ⼯作流
    go 整分钟开始执行程序
    vue 保留两位小数
    vue 格式化时间戳
    Supervisor-进程守护工具
    为什么计算机语言中的变量名都不能以数字开头呢?
  • 原文地址:https://www.cnblogs.com/langkyeSir/p/15174846.html
Copyright © 2011-2022 走看看