You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
When a project (or sub-project) has publishArtifact := false, codeArtifactPublish still attempts to publish artifacts, which fails like this:
sbt:jobs> codeArtifactPublish
[info] Uploading com/cibo/jobs_2.12/maven-metadata.xml
[error] stack trace is suppressed; run last codeArtifactPublish for the full output
[error] (codeArtifactPublish) Failed to publish to AWS Codeartifact. Errors:
[error] Code: 404, message: No package found with groupId: 'com.cibo' & artifactId: 'jobs_2.12'
[error] Total time: 1 s, completed Nov 28, 2023, 7:45:57 PM
sbt:jobs>
This seems pretty simple to fix:
diff --git a/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala b/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala
index 77bf616..9d0454c 100644
--- a/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala
+++ b/sbt-codeartifact/src/main/scala/codeartifact/CodeArtifactPlugin.scala
@@ -60,10 +60,11 @@ object CodeArtifactPlugin extends AutoPlugin {
// See: https://www.scala-sbt.org/1.x/docs/Howto-Dynamic-Task.html
private def dynamicallyPublish: Def.Initialize[Task[Unit]] = Def.taskDyn {
val shouldSkip = (publish / skip).value
+ val publishEnabled = (publish / publishArtifact).value
val logger = streams.value.log
val ref = thisProjectRef.value
- if (shouldSkip) Def.task {
+ if (shouldSkip || !publishEnabled) Def.task {
logger.debug(s"Skipping publish for ${ref.project}")
}
else publish0
Thoughts?
The text was updated successfully, but these errors were encountered:
When a project (or sub-project) has
publishArtifact := false
,codeArtifactPublish
still attempts to publish artifacts, which fails like this:This seems pretty simple to fix:
Thoughts?
The text was updated successfully, but these errors were encountered: