How to get the Maven plug-in when running Build projects?

0

Build projects Build projects

source

env

other

build log

[Container] 2024/03/15 03:09:23.965498 Running command mvn clean install
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/ahs/etl.parent/1.0/etl.parent-1.0.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.ahs:etl-home:2.0: The following artifacts could not be resolved: com.ahs:etl.parent:pom:1.0 (absent): Could not find artifact com.ahs:etl.parent:pom:1.0 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 7, column 13
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.ahs:etl-home:2.0 (/codebuild/output/src794098553/src/git-codecommit.us-east-2.amazonaws.com/v1/repos/etl-home/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.ahs:etl-home:2.0: The following artifacts could not be resolved: com.ahs:etl.parent:pom:1.0 (absent): Could not find artifact com.ahs:etl.parent:pom:1.0 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 7, column 13 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

[Container] 2024/03/15 03:09:34.440711 Command did not exit successfully mvn clean install exit status 1
[Container] 2024/03/15 03:09:34.444096 Phase complete: BUILD State: FAILED
[Container] 2024/03/15 03:09:34.444114 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: mvn clean install. Reason: exit status 1
DD-Boom
질문됨 2달 전149회 조회
1개 답변
0

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

https://stackoverflow.com/questions/12926952/non-resolvable-parent-pom-for-could-not-find-artifact-and-parent-relativepath

[5] - Maven complaining about parent relative path

https://stackoverflow.com/questions/37062491/maven-complaining-about-parent-relative-path/37068864

AWS
지원 엔지니어
답변함 2달 전
profile picture
전문가
검토됨 2달 전
  • "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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠