In order to update the CodeArtifact token simply perform the following
- Install AWS CLI on your machine
- Configure it accordingly
- Add the server to the settings.xml file
- Reference the following token
${env.CODEARTIFACT_AUTH_TOKEN}
- Create a file called
.mavenrc
under~/
- Add the following code to the file
export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain [domain] --domain-owner [domain_owner] --query authorizationToken --output text`