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)。
      使用示例

  • 相关阅读:
    太有才了!街头创意涂鸦手绘图片欣赏【上篇】
    设计前沿:25款精妙的 iOS 应用程序图标
    Web 前端开发精华文章集锦(jQuery、HTML5、CSS3)【系列十八】
    神奇的世界!那些使用食物创造出来的景观【组图】
    Screenfly – 各种设备的屏幕和分辨率下快速测试网站
    经典网页设计:30个新鲜出炉的扁平化网站设计《下篇》
    40款很奇异的名片设计,吸引你的眼球《下篇》
    推荐25款实用的 HTML5 前端框架和开发工具【下篇】
    CSS3 Animation Cheat Sheet:实用的 CSS3 动画库
    今日推荐:12个获取手机应用程序设计灵感的网站
  • 原文地址:https://www.cnblogs.com/langkyeSir/p/15174846.html
Copyright © 2011-2022 走看看