【问题标题】:Grails not authenticating to ArtifactoryGrails 未对 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

为什么不认证?

【问题讨论】:

    标签: maven grails ivy


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-23
      • 1970-01-01
      • 2014-01-27
      • 1970-01-01
      • 2020-04-19
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      相关资源
      最近更新 更多