gpt4 book ai didi

grails - 使用Grails项目配置Artifactory

转载 作者:行者123 更新时间:2023-12-02 15:00:31 30 4
gpt4 key购买 nike

我正在尝试使用远程Grails配置Artifactory项目,但是无法正确配置它。

Envionmanet设置

  1. grails-2.4.3
  2. artifactory.version 3.3.0


BuildConfig.groovy
grails.project.dependency.resolver = "maven" // or ivy

grails.project.ivy.authentication = {
repositories {
mavenRepo "http://SERVER/artifactory/grails-remote"
}
credentials {
realm = "Artifactory Realm"
host = "SERVER"
username = "USERNAME"
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 "warn" // 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 true // Whether to inherit repository definitions from plugins
mavenRepo id: 'Artifactory', url: "http://SERVER/artifactory/grails-remote"
}

dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
test "org.grails:grails-datastore-test-support:1.0-grails-2.4"
}

plugins {
// plugins for the build system only
build ":tomcat:7.0.55"

// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.7'
compile ":asset-pipeline:1.9.6"

compile ":rabbitmq:1.0.0"

// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.5.5" // or ":hibernate:3.6.10.17"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
}
}

在为项目执行refresh-dependencies命令后获取以下异常
Loading Grails 2.4.3
|Configuring classpath
Error |
Resolve error obtaining dependencies: The following artifacts could not be resolved: org.grails.plugins:scaffolding:zip:2.1.2, org.grails.plugins:cache:zip:1.1.7, org.grails.plugins:webxml:zip:1.4.1, org.grails.plugins:asset-pipeline:zip:1.9.6, org.grails.plugins:rabbitmq:zip:1.0.0, org.grails.plugins:hibernate4:zip:4.3.5.5, org.grails.plugins:database-migration:zip:1.4.0, org.grails.plugins:jquery:zip:1.11.1: Could not find artifact org.grails.plugins:scaffolding:zip:2.1.2 in Artifactory (http://SERVER/artifactory/grails-remote) (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: The following artifacts could not be resolved: org.grails.plugins:scaffolding:zip:2.1.2, org.grails.plugins:cache:zip:1.1.7, org.grails.plugins:webxml:zip:1.4.1, org.grails.plugins:asset-pipeline:zip:1.9.6, org.grails.plugins:rabbitmq:zip:1.0.0, org.grails.plugins:hibernate4:zip:4.3.5.5, org.grails.plugins:database-migration:zip:1.4.0, org.grails.plugins:jquery:zip:1.11.1: Could not find artifact org.grails.plugins:scaffolding:zip:2.1.2 in Artifactory (http://SERVER/artifactory/grails-remote) (Use --stacktrace to see the full trace)
Error |
Resolve error obtaining dependencies: The following artifacts could not be resolved: org.grails.plugins:scaffolding:zip:2.1.2, org.grails.plugins:cache:zip:1.1.7, org.grails.plugins:webxml:zip:1.4.1, org.grails.plugins:asset-pipeline:zip:1.9.6, org.grails.plugins:rabbitmq:zip:1.0.0: Could not find artifact org.grails.plugins:scaffolding:zip:2.1.2 in Artifactory (http://SERVER/artifactory/grails-remote) (Use --stacktrace to see the full trace)
Error |
The following artifacts could not be resolved: org.grails.plugins:scaffolding:zip:2.1.2, org.grails.plugins:cache:zip:1.1.7, org.grails.plugins:webxml:zip:1.4.1, org.grails.plugins:asset-pipeline:zip:1.9.6, org.grails.plugins:rabbitmq:zip:1.0.0: Could not find artifact org.grails.plugins:scaffolding:zip:2.1.2 in Artifactory (http://SERVER/artifactory/grails-remote)
|Run 'grails dependency-report' for further information.
Process was killed

我已经阅读并尝试了以下链接中所述的几种解决方案,但无济于事
  • How to configure grails 2.4.0 to resolve artifacts from artifactory with authentication?
  • http://wordpress.transentia.com.au/wordpress/2014/04/09/artifactory-and-grails/

  • 更新1:

    仔细研究 Artifactory's apache catalina log后,我发现对于某些插件,它引起了一些禁止的错误。
    2014-10-15 15:16:19,596 [ajp-bio-8019-exec-10] [INFO ] (o.a.r.s.RepositoryBrowsingServiceImpl:236) - Error while listing remote resources for codehaus/org/grails/grails-datastore-gorm-mongo: Unable to retrieve http://repository.codehaus.org/org/grails/grails-datastore-gorm-mongo/: 403: Forbidden

    谁能帮我找出配置问题吗?

    问候,
    马扬克

    最佳答案

    与其使用grails.project.ivy.authentication定义存储库身份验证,不如使用以下方法定义存储库:

    grails.project.dependency.resolution = {
    repositories {
    grailsCentral()
    ....
    mavenRepo(name: 'name', url: 'https://host/artifactory/reponame') {
    auth(username: 'username', password: 'password')
    }
    ....
    }
    }

    关于grails - 使用Grails项目配置Artifactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26377380/

    30 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com