Authentication grails maven插件无法读取settings.groovy

Authentication grails maven插件无法读取settings.groovy,authentication,maven,grails,settings,grails-maven,Authentication,Maven,Grails,Settings,Grails Maven,我有一个Grails应用程序,它在需要身份验证的MavenRepos中具有依赖性。 因此,我在我的设置中设置了以下属性 grails.project.ivy.authentication = { credentials { realm = "Sonatype Nexus Repository Manager" host = "testnexus.testserver.com" username = "testuser123"

我有一个Grails应用程序,它在需要身份验证的MavenRepos中具有依赖性。 因此,我在我的设置中设置了以下属性

grails.project.ivy.authentication = {
    credentials {
        realm = "Sonatype Nexus Repository Manager"
        host = "testnexus.testserver.com"
        username = "testuser123"
        password = "password123"
    }
}
当使用Grails构建时,这很好。读取凭据,对Nexus查询进行身份验证,下载依赖项

由于我的应用程序是使用Maven进行依赖关系管理的大型项目的一部分,因此我使用grails Maven插件将我的应用程序集成到大型项目中,这样我就可以保留BuildConfig.groovy,而大型项目则为构建维护其pom.xml文件

当使用调用mvn包时,我看到它是如何触发grails插件的,它启动了我的构建。但是settings.groovy没有被读取,因此我无法解析所有依赖项

try to get credentials for: Sonatype Nexus Repository Manager@testnexus.testserver.com
authentication: k='Sonatype Nexus Repository Manager@testnexus.testserver.com' c='null'
HTTP response status: 401 url=https://testnexus.testserver.com/nexus/content/groups/public/...
CLIENT ERROR: Unauthorized url=https://testnexus.testserver.com/nexus/content/groups/public/...
BuildConfig.groovy中添加凭据时,效果很好,但这不是一个解决方案


如何将grails maven插件配置为读取settings.groovy,或者在何处声明这些凭据以确保grails maven插件读取设置?

您需要创建maven设置,身份验证模型不同