Grails没有对Artifactory进行身份验证

时间:2014-04-22 01:33:44

标签: maven grails ivy

我使用的是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 个答案:

答案 0 :(得分:0)

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