AWS проблема CodeBuild - PullRequest
       7

AWS проблема CodeBuild

1 голос
/ 04 февраля 2020

Я следовал официальному руководству по AWS, чтобы собрать и протестировать мое приложение android с использованием CodePipeline, но журнал сборки сообщает:

[Container] 2020/02/04 17:25:04 Running command mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.125 s
[INFO] Finished at: 2020-02-04T17:25:09Z
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory 
(/codebuild/output/src849781127/src). Please verify you invoked Maven from the correct directory. -> 
[Help 1]
[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/MissingProjectException

[Container] 2020/02/04 17:25:09 Command did not exit successfully mvn install exit status 1
[Container] 2020/02/04 17:25:09 Phase complete: BUILD State: FAILED
[Container] 2020/02/04 17:25:09 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error 
while executing command: mvn install. Reason: exit status 1
[Container] 2020/02/04 17:25:09 Entering phase POST_BUILD
[Container] 2020/02/04 17:25:09 Running command echo Build completed on `date`
Build completed on Tue Feb 4 17:25:09 UTC 2020

[Container] 2020/02/04 17:25:09 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2020/02/04 17:25:09 Phase context status code:  Message: 
[Container] 2020/02/04 17:25:09 Expanding base directory path: .
[Container] 2020/02/04 17:25:09 Assembling file list
[Container] 2020/02/04 17:25:09 Expanding .
[Container] 2020/02/04 17:25:09 Expanding file paths for base directory .
[Container] 2020/02/04 17:25:09 Assembling file list
[Container] 2020/02/04 17:25:09 Expanding target/messageUtil-1.0.jar
[Container] 2020/02/04 17:25:09 Skipping invalid file path target/messageUtil-1.0.jar
[Container] 2020/02/04 17:25:09 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2020/02/04 17:25:09 Phase context status code: CLIENT_ERROR Message: no matching artifact 
paths found

Я новичок в AWS и я использовал следующую сборку c .yml, которую нашел в официальной документации:

version: 0.2

phases:
  install:
    runtime-versions:
      java: corretto11
  pre_build:
    commands:
      - echo Nothing to do in the pre_build phase...
  build:
    commands:
      - echo Build started on `date`
      - mvn install
  post_build:
    commands:
      - echo Build completed on `date`
artifacts:
  files:
    - target/messageUtil-1.0.jar

Кто-нибудь может мне помочь?

С уважением, Антонио

1 Ответ

1 голос
/ 05 февраля 2020

Я собираюсь поставить свои комментарии в ответ. Похоже, что ваш файл POM отсутствовал в текущем каталоге, когда вы выполнили "mvn install". Если вы используете Maven, в вашем текущем каталоге должен быть файл POM. Что касается ошибки Skipping invalid file path target/messageUtil-1.0.jar Phase complete: UPLOAD_ARTIFACTS State: FAILED Phase context status code: CLIENT_ERROR Message: no matching artifact paths found, вы можете изменить следующее в файле buildspec:

artifacts:
  files:
    - '**/*'

Это будет захватывать все, включая ваш файл JAR.

...