是否可以在没有 Maven / Gradle 的情况下创建 Google App Engine 应用程序?

时间:2021-06-29 16:40:13

标签: java google-app-engine java-11

我使用 jdk11 中捆绑的 body { background: #fafafa; color: #333333; margin-top: 5rem; } h1, h2, h3, h4, h5, h6 { color: #444444; } .bg-steel { background-color: #5f788a; } .site-header .navbar-nav .nav-link { color: #cbd5db; } .site-header .navbar-nav .nav-link:hover { color: #ffffff; } .site-header .navbar-nav .nav-link.active { font-weight: 500; } .content-section { background: #ffffff; padding: 10px 20px; border: 1px solid #dddddd; border-radius: 3px; margin-bottom: 20px; } .article-title { color: #444444; } a.article-title:hover { color: #428bca; text-decoration: none; } .article-content { white-space: pre-line; } .article-img { height: 65px; width: 65px; margin-right: 16px; } .article-metadata { padding-bottom: 1px; margin-bottom: 4px; border-bottom: 1px solid #e3e3e3 } .article-metadata a:hover { color: #333; text-decoration: none; } .article-svg { width: 25px; height: 25px; vertical-align: middle; } .account-img { height: 125px; width: 125px; margin-right: 20px; margin-bottom: 16px; } .account-heading { font-size: 2.5rem; } 创建了一个非常简单的 Web 服务器,
而且我没有任何依赖项,所以我什至不想创建 pom 或 gradle 构建文件。

在 Google Cloud Run 中,我可以使用简单的 Dockerfile 编译 *.java 并执行它。
1 个 java 源文件和 1 个 Dockerfile 执行如下工作:

<!DOCTYPE html>
<html>

<head>
  <title>Page Title</title>
</head>

<body>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">

  <article class="media content-section">
    <img class="rounded-circle article-img" src="https://via.placeholder.com/80">

    <div class="media-body">
      <div class="article-metadata">
        <a class="mr-2" href="#">Author 1</a>
        <small class="text-muted">29-June-2021</small>
      </div>

      <h2><a class="article-title" href="{{ url_for('post', post_id=post.id) }}">Post 1</a></h2>

      <p class="article-content">Post 1 Post 1 Post 1</p>
    </div>
  </article>

  <article class="media content-section">
    <img class="rounded-circle article-img" src="https://via.placeholder.com/80">

    <div class="media-body">
      <div class="article-metadata">
        <a class="mr-2" href="#">Author 2</a>
        <small class="text-muted">29-June-2021</small>
      </div>

      <h2><a class="article-title" href="{{ url_for('post', post_id=post.id) }}">Post 2</a></h2>

      <p class="article-content">Post 2 Post 2 Post 2 Post 2</p>
    </div>
  </article>

</body>

</html>
com.sun.net.httpserver.HttpServer

是否可以在 App Engine 中实现?

1 个答案:

答案 0 :(得分:0)

您可以在本地构建一个可执行 JAR,然后部署它。

请参阅以下链接的更多详细信息: https://cloud.google.com/appengine/docs/standard/java11/testing-and-deploying-your-app#other_deployment_options

相关问题