Amazon web services AWS代码构建问题
我遵循AWS的官方指南,使用CodePipeline构建和测试我的android应用程序,但构建日志显示:Amazon web services AWS代码构建问题,amazon-web-services,build,devops,Amazon Web Services,Build,Devops,我遵循AWS的官方指南,使用CodePipeline构建和测试我的android应用程序,但构建日志显示: [Container] 2020/02/04 17:25:04 Running command mvn install [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [IN
[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新手,我使用了我在官方文档中找到的以下buildspec.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
有人能帮我吗
问候,,
安东尼奥我要把我的评论写在一个答案里。执行“mvn安装”时,您的POM文件似乎不在当前目录中。如果您使用的是Maven,则当前目录中需要有一个POM文件。至于跳过无效文件路径target/messageUtil-1.0.jar阶段完成:上载\u工件状态:失败阶段上下文状态代码:客户端\u错误消息:未找到匹配工件路径错误您可以在
buildspec
文件中更改以下内容:
artifacts:
files:
- '**/*'
它将抓取所有内容,包括您的JAR文件。我对Java了解不多,但在执行“mvn安装”时,您的POM文件似乎不在当前目录中。你在用Maven吗?如果是,您的目录中是否有POM文件?如果您不知道这些问题的答案,只需在mvn安装之前在“commands:
-ls-la
下的buildspec中添加一行即可。您是对的,非常感谢。我已经创建了pom.xml文件,但我不知道如何为我自己的项目编写最后一行;它应该是这样的:artifacts:files:-target/messageUtil-1.0.jar但构建控制台告诉:跳过无效的文件路径target/messageUtil-1.0.jar阶段完成:上载\u工件状态:失败的阶段上下文状态代码:客户端\u错误消息:找不到匹配的工件路径您能帮助我吗?