- Newest
- Most votes
- Most comments
Hi,
I'm Zainub from AWS Premium Support and it will be my pleasure assisting you on this question.
From the correspondence, I understand that guidance is required on how to access the CodeArtifact Maven packages when running CodeBuild builds. Kindly confirm if the summary and understanding of the issue is correct.
In order to allow CodeBuild to access the Maven packages, perform the following steps [1]:
- Update the CodeBuild project role to allow the following actions:
- codeartifact:GetAuthorizationToken
- codeartifact:GetRepositoryEndpoint
- codeartifact:ReadFromRepository
- sts:GetServiceBearerToken
- Store the CodeArtifact auth token in an environment variable, as described in "Pass an auth token in an environment variable" [2]:
export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain my_domain --domain-owner 111122223333 --query authorizationToken --output text`
- You must configure your Maven configuration files (settings.xml and pom.xml) following the instructions in "Using CodeArtifact with mvn" [3].
See [1] for detailed steps.
With regards to the Non-resolvable parent POM, from my research, this may be related to the relative path [4][5]. Kindly note that issues on a code level falls beyond the level of support generally provided and this guidance is provided on a best effort basis.
I hope you find the above informative! Should further guidance be required, feel free to open a Premium Support case.
Have a great day ahead.
References:
[1] - Using Maven packages in CodeBuild:
https://docs.aws.amazon.com/codeartifact/latest/ug/using-maven-packages-in-codebuild.html
[2] - AWS CodeArtifact authentication and tokens - Pass an auth token using an environment variable:
https://docs.aws.amazon.com/codeartifact/latest/ug/tokens-authentication.html#env-var
[3] - Use CodeArtifact with mvn
https://docs.aws.amazon.com/codeartifact/latest/ug/maven-mvn.html
[4] - Non-resolvable parent POM for Could not find artifact and 'parent.relativePath' points at wrong local POM
[5] - Maven complaining about parent relative path
https://stackoverflow.com/questions/37062491/maven-complaining-about-parent-relative-path/37068864
Relevant content
- asked a year ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
"Store the CodeArtifact auth token in an environment variable, as described in "Pass an auth token in an environment variable" [2]:"I have also done this step, but I have no idea where to configure this, because the code specifies The source is manually uploaded to CodeCommit from the Windows server. I don't know the specific meaning of this step.