I created AWS CodeArtifact repository, obtained token with aws codeartifact get-authorization-token
command, and set it correctly to .m2/settings.xml
(my project is using maven
as build tool & package manager).
The problem is that the token expires after 12 hours. This means that I and all the developers working on the project have to fetch a new token and set the new token in settings.xml
file.
And same has to be done for ci/cd server that also needs to have a connection to CodeArtifact in order to push the artifacts after building.
There has to be a way to solve this problem but unfortunately, I wasn't able to find the solution.