【问题标题】:settings.groovy not read by grails-maven-plugingrails-maven-plugin 未读取 settings.groovy
【发布时间】:2013-01-17 10:45:18
【问题描述】:

我有一个 Grails 应用程序,它在 MavenRepos 中具有需要身份验证的依赖项。 因此,我在 settings.groovy 中设置了以下属性。

grails.project.ivy.authentication = {
    credentials {
        realm = "Sonatype Nexus Repository Manager"
        host = "testnexus.testserver.com"
        username = "testuser123"
        password = "password123"
    }
}

当使用 Grails 构建时,这可以正常工作。读取凭据,对 Nexus 查询进行身份验证,下载依赖项。

由于我的应用程序是使用 Maven 进行依赖管理的较大项目的一部分,因此我使用 grails-maven-plugin 将我的应用程序集成到较大的项目中,这样我就可以在较大的项目中保留 BuildConfig.groovy项目维护其用于构建的 pom.xml 文件。

当使用调用 mvn package 时,我看到它是如何触发 grails 插件的,它会启动我的构建。但是 settings.groovy 没有被读取,因此我将无法解决所有依赖项。

try to get credentials for: Sonatype Nexus Repository Manager@testnexus.testserver.com
authentication: k='Sonatype Nexus Repository Manager@testnexus.testserver.com' c='null'
HTTP response status: 401 url=https://testnexus.testserver.com/nexus/content/groups/public/...
CLIENT ERROR: Unauthorized url=https://testnexus.testserver.com/nexus/content/groups/public/...

BuildConfig.groovy 中添加凭据时,它可以正常工作,但这不是解决方案。

如何配置 grails-maven-plugin 以读取 settings.groovy,或者我可以在哪里声明这些凭据以供 grails-maven-plugin 读取?

【问题讨论】:

    标签: authentication maven grails settings grails-maven


    【解决方案1】:

    需要创建maven设置,认证模型不一样。

    http://maven.apache.org/settings.html

    【讨论】:

      猜你喜欢
      • 2015-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-28
      • 2013-09-29
      • 2014-09-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多