I've configured an S3 backed Maven repository per the instructions here, eg:
repositories {
maven {
url "s3://myCompanyBucket/maven2"
authentication {
awsIm(AwsImAuthentication) // load from EC2 role or env var
}
}
}
I am trying to convert my script to use the Kotlin DSL instead of groovy, but can't figure out the equivalent code, specifically for the authentication portion.
What is the equivalent Kotlin DSL for the Groovy snippet above?
I just managed to configure a HttpHeaderAuthentication through the following:
maven {
credentials(HttpHeaderCredentials::class.java) {
name = "Private-Token"
value = "xxxxxxx"
}
authentication {
val header by registering(HttpHeaderAuthentication::class)
}
url = uri("https://xxxxxxxx/")
}
So I guess yours should be something like
repositories {
maven {
url = uri("s3://myCompanyBucket/maven2")
authentication {
val awsIm by registering(AwsImAuthentication::class) // load from EC2 role or env var
}
}
}
HTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With