我通过3个步骤为SpringBoot Java应用程序构建了一个简单的CodePipeline:
1和2步骤成功通过,而部署步骤失败。我在Elastic Beanstalk日志中看到的唯一错误:
01_configure_application.sh] : Activity execution failed, because: Executing: /usr/bin/unzip -o -d /var/app/staging /opt/elasticbeanstalk/deploy/appsource/source_bundle
FileMagic v0.7.1: compiled magic version [5.21] does not match with shared library magic version [5.37]
Archive: /opt/elasticbeanstalk/deploy/appsource/source_bundle
inflating: /var/app/staging/microservices/my-service/target/my-service.jar
Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile.
Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile. (ElasticBeanstalk::ExternalInvocationError)
caused by: Executing: /usr/bin/unzip -o -d /var/app/staging /opt/elasticbeanstalk/deploy/appsource/source_bundle
FileMagic v0.7.1: compiled magic version [5.21] does not match with shared library magic version [5.37]
Archive: /opt/elasticbeanstalk/deploy/appsource/source_bundle
inflating: /var/app/staging/microservices/my-service/target/my-service.jar
Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile.
Unable to launch application as the source bundle does not contain either a file named application.jar or a Procfile. (Executor::NonZeroExitStatus)
我的构建说明:
build:
commands:
- mvn -P ci --settings settings.xml install -DskipTests
artifacts:
files:
- microservices/my-service/target/my-service.jar
如果我使用AWS Web Interface将这个jar直接部署到AWS Elastic Beanstalk,它会完美地工作。
[请帮帮我。我准备按需共享任何其他配置。
artifacts:
files:
- microservices/my-service/target/my-service.jar
唯一正确的方法是folder/myapp.jar
,例如:
artifacts: files: - target/my-service.jar
因此,如果不同,则应在maven配置中指定outputDirectory