首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AWS CodePipeline将Spring应用程序部署到源代码根级的弹性BeansTalk无.jar文件

AWS CodePipeline将Spring应用程序部署到源代码根级的弹性BeansTalk无.jar文件
EN

Stack Overflow用户
提问于 2022-02-27 13:23:58
回答 1查看 247关注 0票数 0

我用3个步骤为一个CodePipeline应用程序构建了一个简单的SpringBoot:

代码语言:javascript
复制
Source: get the source from GitHub 
Build: a jar file 
Deploy: to an AWS Elastic Beanstalk instance

我在日志中有这个错误

命令应用程序部署- CheckProcfileForJavaApplication的执行过程中发生了错误.停止运行命令。错误:在源包的根级没有Procfile和.jar文件

我的建筑规范:

代码语言:javascript
复制
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时,它工作得很好,但是当它在管道上运行时,它就不起作用了.

提前感谢

EN

回答 1

Stack Overflow用户

发布于 2022-02-27 18:19:26

我找到了解决办法

AWS BS没有在pckaging文件夹中找到jar,他找到了target/xx.jar,我用这个命令将jar移动到主文件夹

代码语言:javascript
复制
  - mv target/*.jar app.jar

满是建筑规格

代码语言:javascript
复制
 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.jar
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71285120

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档