1

I'm trying to publish a file to AWS CodeArtifact using curl, as described here: AWS: Publishing with curl

This works until I try to publish a SNAPSHOT version, e.g. add -SHAPSHOT to the end of the version. When I append -SNAPSHOT to the version I get

Invalid name for a Snapshot build asset: 'packageName-version-SNAPSHOT.tar.gz'

Of course, replace "packageName" and "version" with the actual package name and version strings.

The curl command looks like this:

curl --request PUT "${repositoryEndpointAttainedFromAwsCli}/${repositoryName}/${packageNamespaceWithSlashesInsteadOfDots}/${packageName}/${packageVersion}/${packageName}-${packageVersion}.tar.gz" --user "aws:${authTokenAttainedFromAwsCli}" --header 'Content-Type: application/octet-stream' --data-binary @package.tar.gz

When ${packageVersion} ends with -SNAPSHOT I get the error. When ${packageVersion} doesn't end with -SNAPSHOT the publish works.

I need to publish snapshots. So what am I'm I doing wrong with the snapshot versioning?

Zdenik
  • 406
  • 1
  • 4
  • 13

1 Answers1

1

There is a problem with the example on the link you listed for the SNAPSHOT case and it is currently under investigation:

For now, try the following format:

curl --request PUT https://my_domain-111122223333.d.codeartifact.us-east-2.amazonaws.com/maven/maven-central-store/com/basicapp/myapp/1.0-SNAPSHOT --user "aws:$CODEARTIFACT_AUTH_TOKEN" --data-binary @/myapp-1.0-SNAPSHOT.jar
shariqmaws
  • 8,152
  • 1
  • 16
  • 35