我用3个步骤为一个CodePipeline应用程序构建了一个简单的SpringBoot:
Source: get the source from GitHub
Build: a jar file
Deploy: to an AWS Elastic Beanstalk instance我在日志中有这个错误
命令应用程序部署- CheckProcfileForJavaApplication的执行过程中发生了错误.停止运行命令。错误:在源包的根级没有Procfile和.jar文件
我的建筑规范:
version: 0.2
#env:
#variables:
# key: "value"
# key: "value"
#parameter-store:
# key: "value"
# key: "value"
#secrets-manager:
# key: secret-id:json-key:version-stage:version-id
# key: secret-id:json-key:version-stage:version-id
#exported-variables:
# - variable
# - variable
#git-credential-helper: yes
#batch:
#fast-fail: true
#build-list:
#build-matrix:
#build-graph:
phases:
install:
runtime-versions:
java: corretto11
#If you use the Ubuntu standard image 2.0 or later, you must specify runtime-versions.
#If you specify runtime-versions and use an image other than Ubuntu standard image 2.0, the build fails.
#runtime-versions:
# name: version
# name: version
#commands:
# - command
# - command
#pre_build:
#commands:
# - command
# - command
build:
commands:
- mvn install
# - command
# - command
#post_build:
#commands:
# - command
# - command
#reports:
#report-name-or-arn:
#files:
# - location
# - location
#base-directory: location
#discard-paths: yes
#file-format: JunitXml | CucumberJson
artifacts:
files:
- target/sbk-0.0.2.jar
# - location
# - location
#name: $(date +%Y-%m-%d)
#discard-paths: yes
#base-directory: location
#cache:
#paths:
# - paths

当我手动上传到EBS时,它工作得很好,但是当它在管道上运行时,它就不起作用了.
提前感谢
发布于 2022-02-27 18:19:26
我找到了解决办法
AWS BS没有在pckaging文件夹中找到jar,他找到了target/xx.jar,我用这个命令将jar移动到主文件夹
- mv target/*.jar app.jar满是建筑规格
version: 0.2
phases:
install:
runtime-versions:emphasized text
java: corretto11
commands:
- echo install
pre_build:
commands:
- echo pre_build
build:
commands:
- mvn package
- echo build
post_build:
commands:
- echo post_build
- mv target/*.jar app.jar
artifacts:
files:
- app.jarhttps://stackoverflow.com/questions/71285120
复制相似问题