【问题标题】:Grails global repository credentialsGrails 全局存储库凭据
【发布时间】:2016-10-22 21:54:39
【问题描述】:

有人知道如何在 USER_HOME/.grails/settings.groovy 文件中为自定义存储库指定凭据吗?

目前看起来像:

grails {
  profiles {
    repositories {
      myRepo {
        url = "http://foo.com/repo"
        snapshotsEnabled = true
      }
      grailsCentral {
        url = "https://repo.grails.org/grails/core"
        snapshotsEnabled = true
      }
    }
  }
}

但是没有关于如何为“myRepo”指定用户名/密码的文档。

我正在使用 Grails 3。

【问题讨论】:

    标签: grails grails-3.0 grails-3.1


    【解决方案1】:

    Grails 3 使用Gradle 进行构建。构建配置详细信息存储在 build.gradle 中。您可以插入凭据以访问此文件中的存储库。请参见下面的示例:

    repositories {
        maven {
            url "url to repo"
            credentials {
                username = "username"
                password = "password"
            }
        }
    }
    

    【讨论】:

    • 没关系,但我的意思是当您使用位于私有存储库中的自定义配置文件创建新应用程序时。因此,此时没有项目,因此没有可用的 build.gradle。
    猜你喜欢
    • 2012-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-31
    相关资源
    最近更新 更多