Question

I'm using grails 2.2.3

I'm trying to get maven-deploy to work.

My grails BuildConfig.groovy contains: (Server and credentials changed)

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"
    }

Log on the Artifactory server contains:

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

Why is it not Authenticating?

Was it helpful?

Solution

I found that add server authentication settings to ~/.m2/settings.xml and then the project would build.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top