Grails 未对 Artifactory 进行身份验证

Posted

技术标签:

【中文标题】Grails 未对 Artifactory 进行身份验证【英文标题】:Grails not authenticating to Artifactory 【发布时间】:2014-06-06 04:40:09 【问题描述】:

我正在使用 grails 2.2.3

我正在尝试让 maven-deploy 工作。

我的 grails BuildConfig.groovy 包含:(服务器和凭据已更改)

grails.project.ivy.authentication = 
    credentials 
        realm = "Artifactory Realm"
        host = "SERVER_NAME"
        username = "USER"
        password = "PASSWORD"
    


grails.project.dependency.resolution = 
    // inherit Grails' default dependencies
    inherits("global") 
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
    
    log "info" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve
    legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

    repositories 
        inherits false // Whether to inherit repository definitions from plugins

        mavenLocal()

        mavenRepo root = "http://SERVER_NAME:8081/artifactory/remote-repos"

        // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    

    dependencies 
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.

        // runtime 'mysql:mysql-connector-java:5.1.22'

        runtime 'com.oracle:ojdbc6:11.2.0.1.0'

        compile 'org.jadira.usertype:usertype.jodatime:1.9'
    

    plugins 
        runtime ":hibernate:$grailsVersion"
        runtime ":resources:1.2"

        // Uncomment these (or add new ones) to enable additional resources capabilities
        //runtime ":zipped-resources:1.0"
        //runtime ":cached-resources:1.0"
        //runtime ":yui-minify-resources:0.1.5"

        build ":tomcat:$grailsVersion"
        build ":release:2.2.1"

        runtime ":database-migration:1.3.2"

        compile ':cache:1.0.1'

        compile ":joda-time:1.4"
    

登录 Artifactory 服务器包含:

20140422112526|1|REQUEST|10.68.33.10|non_authenticated_user|GET|/remote-repos/org/apache/maven/wagon/wagon-http/1.0-beta-2/wagon-http-1.0-beta-2.jar|HTTP/1.1|401|0

为什么不认证?

【问题讨论】:

【参考方案1】:

我发现将服务器身份验证设置添加到 ~/.m2/settings.xml 然后项目就会构建。

【讨论】:

以上是关于Grails 未对 Artifactory 进行身份验证的主要内容,如果未能解决你的问题,请参考以下文章

Artifactory 中的 SSH 身份验证

如何从 buildscript 发送 Artifactory 发布凭据而不对其进行硬编码?

Sql Server 数据透视表未对结果集进行分组

oprofile 未对 LLC_MISSES 缓存事件进行采样

Jackson 未对 JPA id 字段进行序列化

使用docker安装Artifactory及配置