This message was deleted.
# community-support
s
This message was deleted.
d
Possibly once again not doing this the best way. I've reworked to define a curried function that I can then pass to the build.gradle by adding it to the
gradle.ext
global and referencing it via the same property name. e.g.:
Copy code
def configureRepositories = { configObject, token ->
        configObject.repositories {
                maven {
                        name repoName.replace('-', '')
                        url "https://${domain}-${domainOwner}.d.codeartifact.${region}.<http://amazonaws.com/maven/${repoName}/|amazonaws.com/maven/${repoName}/>"
                        credentials {
                                username 'aws'
                                password token
                        }
                }
        }
}

def configRepos = configureRepositories.rcurry(artifactAuthToken)
configRepos(settings.pluginManagement)
configRepos(settings.dependencyResolutionManagement)
gradle.ext.configRepos = configRepos
Then at the end of build.gradle:
Copy code
gradle.ext.configRepos(publishing)
Possibly there are better ways, but this means just need to drop the one file in to most projects and it's a small addition to the root build.gradle and should then work