Skip to content

Commit dcac308

Browse files
Merge pull request #8 from Iterable/MOB-8614
Update error message.
2 parents eac4a50 + a4ed8c1 commit dcac308

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactKeys.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ trait CodeArtifactKeys {
2020

2121
val codeArtifactResolvers: SettingKey[List[String]] =
2222
settingKey[List[String]]("Additional CodeArtifact repos from which to consume packages.")
23+
24+
val codeArtifactGetTokenInstructions =
25+
settingKey[Option[String]]("Instructions on how to get a token for CodeArtifact")
2326
}
2427

2528
trait InternalCodeArtifactKeys {

sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ object CodeArtifactPlugin extends AutoPlugin {
1818

1919
def buildPublishSettings: Seq[Setting[_]] = Seq(
2020
ThisBuild / codeArtifactUrl := "",
21+
ThisBuild / codeArtifactGetTokenInstructions := None,
2122
ThisBuild / codeArtifactResolvers := Nil
2223
)
2324

@@ -43,7 +44,20 @@ object CodeArtifactPlugin extends AutoPlugin {
4344
),
4445
credentials ++= {
4546
val token = codeArtifactToken.value.getOrElse {
46-
streams.value.log.warn("Unable to get AWS CodeArtifact auth token.")
47+
streams.value.log.warn(
48+
"""
49+
| ___ ______ ____ _ _ _ _ __ _
50+
| / \ \ / / ___| / ___|___ __| | ___ / \ _ __| |_(_)/ _| __ _ ___| |_
51+
| / _ \ \ /\ / /\___ \ | | / _ \ / _` |/ _ \ / _ \ | '__| __| | |_ / _` |/ __| __|
52+
| / ___ \ V V / ___) | | |__| (_) | (_| | __// ___ \| | | |_| | _| (_| | (__| |_
53+
|/_/ \_\_/\_/ |____/ \____\___/ \__,_|\___/_/ \_\_| \__|_|_| \__,_|\___|\__|
54+
|
55+
|
56+
|The AWS CodeArtifact sbt plugin was not able to get a valid auth token. If you recieve and error due to
57+
|the a dependency not being found then it could be caused by this.""".stripMargin
58+
)
59+
val instructions = codeArtifactGetTokenInstructions.value.map("\n" + _ + "\n").getOrElse("")
60+
streams.value.log.warn(instructions)
4761
""
4862
}
4963
val repos = codeArtifactRepo.value +: codeArtifactResolvers.value

0 commit comments

Comments
 (0)