認証が必要なMavenReposに依存関係があるGrailsアプリケーションがあります。したがって、 settings.groovyに次のプロパティを設定しました。
grails.project.ivy.authentication = {
credentials {
realm = "Sonatype Nexus Repository Manager"
host = "testnexus.testserver.com"
username = "testuser123"
password = "password123"
}
}
Grailsを使用して構築する場合、これは正常に機能します。クレデンシャルが読み取られ、Nexusクエリが認証され、依存関係がダウンロードされます。
私のアプリケーションは依存関係管理にMavenを使用する大規模なプロジェクトの一部であるため、大規模なプロジェクトにアプリケーションを統合するためにgrails-maven-pluginを使用しています。これにより、大規模なプロジェクトがビルド用のpom.xmlファイル。
mvn packageの呼び出しを使用すると、ビルドを開始する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にクレデンシャルを追加すると、正常に機能しますが、それは解決策にはなりません。
settings.groovyを読み取るようにgrails-maven-pluginを構成するにはどうすればよいですか、またはgrails-maven-pluginが読み取るようにこれらのクレデンシャルをどこで宣言できますか?