weixin_39822184
weixin_39822184
2020-12-09 11:59

Support deploying exploded WAR/JAR for Java11

Currently, the artifact config is waiting for a single JAR/WAR/Binary file to be uploaded, but this constraint has nothing to do with the gcloud app deploy command.

The use case: explode WAR file in order to configure static resources with Java11 application.

I'm referring to the approach described in the docs that allows deploying static files for Spring Boot uber-jar app: https://cloud.google.com/appengine/docs/standard/java11/serving-static-files#configuring_your_static_file_handlers

该提问来源于开源项目:GoogleCloudPlatform/app-gradle-plugin

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

10条回答

  • weixin_39612058 weixin_39612058 5月前

    is this a supported runtime on appengine right now?

    点赞 评论 复制链接分享
  • weixin_39822184 weixin_39822184 5月前

    AppEngine 11 is GA since October 2019. We're actively using the Gradle plugin for a couple of years already and it was a bit disappointing that the YAML part is much less powerful. Jetty-related staging configs really made a difference and now I'm struggling to find a somewhat usable Gradle plugin to create the effective web.xml for Jetty and to explode the WAR to prepare the static resources.

    点赞 评论 复制链接分享
  • weixin_39612058 weixin_39612058 5月前

    Appegine 11 doesn't support war deployments as far as I can recall. Exploded war deployments are a Java 8 only feature.

    点赞 评论 复制链接分享
  • weixin_39822184 weixin_39822184 5月前

    AppEngine 11 supports custom entry points. And as far as I understood, if one wants to use the static_files, these static files should be available in the staged folder, so the custom entry point is the only solution.

    So, if you have either a fat Jar or a .jar runner with a .war archive nearby, you'll not be able to use static_files.

    In our case, we have a jetty-runner .jar with our .war application. So, what I'm willing to achieve is to explode the .war file into the staging folder and configure static_files with part of the .war file.

    点赞 评论 复制链接分享
  • weixin_39612058 weixin_39612058 5月前

    Right, at that point you're running an arbitrary container on appengine. Which is fine, but it's not a standard workflow for this plugin. But you are right, there is space for better static file support.

    点赞 评论 复制链接分享
  • weixin_39822184 weixin_39822184 5月前

    Yep. But it looks like with the currently supported workflow the static files are not supported at all for yaml-based deployments?

    Could you please suggest some workaround?

    点赞 评论 复制链接分享
  • weixin_39612058 weixin_39612058 5月前

    Hrmm.. I know we can probably do some work here? Any suggestions in the meantime?

    点赞 评论 复制链接分享
  • weixin_39822184 weixin_39822184 5月前

    are there any updates or suggestions on how to make it easier for developers to work with the static files? I would really appreciate some while we're moving forward with our migration to App Engine 11.

    点赞 评论 复制链接分享
  • weixin_39612058 weixin_39612058 5月前

    Well I think the static files can be supported, just not automatically as they were in java8 (since that was a well defined workflow). I think it might be require more than a trivial amount of work. You would have to do it in your app.yaml directly using the handlers sub section. You can take a look at what the java8 staging does to fill this out.

    Let me try to find some other people that can help document this. ?

    点赞 评论 复制链接分享
  • weixin_39897218 weixin_39897218 5月前

    eak! thnx for the ping. i totally missed this.

    There are several ways to do this, but at the end of the day, the static files needs to be exploded within the app engine deployment directory, and then in app.yaml file, specify the static_files section.

    Here is 's example handlers section for JHipster uberjar deployment: https://github.com/jhipster/generator-jhipster/issues/10331#issuecomment-528563349

    点赞 评论 复制链接分享

相关推荐