繁体   English   中英

使用Nexus调试Grails命令“refresh-dependencies”和maven \\ issues

[英]Debugging Grails command “refresh-dependencies” with maven\issues with Nexus

我在公司网络上,以便检索我们使用Nexus的依赖项。 Grails repo被添加到nexus存储库中,所以现在剩下的就是配置grails以使用nexus。

为了开发Java Maven项目,我只需要指定它应该注意哪个settings.xml文件,因为Nexus URL和凭据存储在那里。

现在我们切换到Grails并且在创建一个新项目时grails挂起在配置类路径上大约200秒(因为它被配置为在200秒后超时)然后说:

Resolve error obtaining dependencies: Failed to read artifact descriptor for jline:jline:jar:2.12 (Use --stacktrace to see the full trace)
Error |
Required Grails build dependencies were not found. This is normally due to internet connectivity issues (such as a misconfigured proxy) or missing repositories in grails-app/conf/BuildConfig.groovy. Please verify your configuration to continue.
Process was killed

现在这可能是repo配置的问题,但是我无法正确调试它。

我试过调用grails refresh-dependencies --stacktrace ,我尝试在Config.groovy中将记录从error更改为debugtrace 尝试在BuildConfig.groovy中将日志记录设置为verbose (但是对于Ivy,我们正在使用Maven,当然它什么都不做),现在我不确定该怎么做。

如果它有帮助,这是我在BuildConfig.groovy当前repo配置:

repositories {
    //inherits true // Whether to inherit repository definitions from plugins       

    grailsPlugins()
    grailsHome()
    mavenLocal()

    mavenRepo(id:'nexusconf', url:"https://nexusurl/repository/rootrepo/") {
        auth username: "user", password: "pass"
    }
    //grailsCentral()
    //mavenCentral()
    // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories          
    //mavenRepo "http://repository.codehaus.org"
    //mavenRepo "http://download.java.net/maven/2/"
    //mavenRepo "http://repository.jboss.com/maven2/"
}

我认为这取决于您使用的是哪个版本的grails,以及您是否使用以太或常春藤进行依赖项解析(使用BuildConfig中的grails.project.dependency.resolver进行设置)。 根据grails 2.4.4文档,要使用Aether进行身份验证,需要在BuildConfig以及USER_HOME / .grails / settings.groovy中进行配置。 要使用Ivy进行身份验证,配置仅在USER_HOME / .grails / settings.groovy中进行。

这是文档说的内容:


使用以太身份验证

要使用Aether进行身份验证,您可以在存储库定义上定义凭据:

mavenRepo(url:"http://localhost:8082/myrepo") { auth username: "foo", password: "bar" }

或者您可以在存储库中指定id:

mavenRepo(id:'myrepo', url:"http://localhost:8082/myrepo")

然后在USER_HOME / .grails / settings.groovy中声明您的凭据:

grails.project.dependency.authentication = { credentials { id = "myrepo" username = "admin" password = "password" } }

与常春藤认证

如果您的存储库需要身份验证,您可以使用凭据块进行配置:

credentials { realm = ".." host = "localhost" username = "myuser" password = "mypass" }

可以使用grails.project.ivy.authentication设置将其放在USER_HOME / .grails / settings.groovy文件中:

grails.project.ivy.authentication = { credentials { realm = ".." host = "localhost" username = "myuser" password = "mypass" } }

这是完整的文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM