【问题标题】:How to deploy war file to heroku using maven?如何使用maven将war文件部署到heroku?
【发布时间】:2017-01-27 17:52:44
【问题描述】:

我正在尝试使用 maven 插件将我的应用程序部署到 heroku。但由于部署似乎成功完成,应用程序没有运行。

在我运行heroku:deploy-war 目标后,我的控制台中有这个

[INFO] -----> Packaging application...
[INFO]        - app: fast-tundra-46883
[INFO]        - including: target/dependency/webapp-runner.jar
[INFO]        - including: target/spring-simple-app-web-0.0.1-SNAPSHOT.war
[INFO] -----> Creating build...
[INFO]        - file: target/heroku/slug.tgz
[INFO]        - size: 13MB
[INFO] -----> Uploading build...
Sep 19, 2016 11:36:54 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://s3-external-1.amazonaws.com:443: Connection reset by peer: socket write error
Sep 19, 2016 11:36:54 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://s3-external-1.amazonaws.com:443
Sep 19, 2016 11:37:15 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://s3-external-1.amazonaws.com:443: Software caused connection abort: socket write error
Sep 19, 2016 11:37:15 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://s3-external-1.amazonaws.com:443
[INFO]        - success
[INFO] -----> Deploying...
[INFO] remote: 
[INFO] remote: -----> heroku-maven-plugin app detected
[INFO] remote: -----> Installing OpenJDK 1.8... done
[INFO] remote: -----> Discovering process types
[INFO] remote:        Procfile declares types -> web
[INFO] remote: 
[INFO] remote: -----> Compressing...
[INFO] remote:        Done: 61M
[INFO] remote: -----> Launching...
[INFO] remote:        Released v8
[INFO] remote:        https://fast-tundra-46883.herokuapp.com/ deployed to Heroku
[INFO] remote: 
[INFO] -----> Done
[INFO] -----------

表示没有任何重大错误。

当我查看heroku中的日志时,我得到了

2016-09-19T22:41:51.185261+00:00 heroku[api]: Deploy null by userxxx@gmail.com
2016-09-19T22:41:51.185261+00:00 heroku[api]: Release v8 created by userxxx@gmail.com
2016-09-19T22:41:51.990503+00:00 heroku[slug-compiler]: Slug compilation started
2016-09-19T22:41:51.990512+00:00 heroku[slug-compiler]: Slug compilation finished

这又不表示任何错误。但是当我导航到我的应用程序应该运行的地址时,在 heroku 中我得到了日志

2016-09-19T22:49:17.825115+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=fast-tundra-46883.herokuapp.com  request_id=4851381b-0fab-49dc-a1a6-d5ebfcad1a97 fwd="79.71.253.17" dyno= connect= service= status=503 bytes=

2016-09-19T22:49:17.825115+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=fast-tundra-46883.herokuapp.com request_id=4851381b-0fab-49dc-a1a6-d5ebfcad1a97 fwd="79.71.253.17" dyno= connect= service= status=503 bytes=
2016-09-19T22:49:17.976534+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=fast-tundra-46883.herokuapp.com request_id=e0a1fc84-6daa-4e1f-a58d-eaf579e170d6 fwd="79.71.253.17" dyno= connect= service= status=503 bytes=

现在我正在使用 heroiku maven 插件,这是它的配置方式

<plugin>
    <groupId>com.heroku.sdk</groupId>
    <artifactId>heroku-maven-plugin</artifactId>
    <version>1.1.1</version>
    <configuration>
        <appName>fast-tundra-46883</appName>
    </configuration>
</plugin>

我尝试使用&lt;processTypes&gt;&lt;/processTypes&gt;,因为我没有Procfile。但是在构建过程中我收到了警告

[WARNING] The <processTypes> value will be ignored when deploying a WAR file. Use `heroku:deploy` goal for custom processes.

它不会改变任何东西。

有人可以帮助我并告诉我我做错了什么吗? 问候

【问题讨论】:

    标签: java maven heroku war


    【解决方案1】:

    尝试运行:

    $ heroku ps:scale web=1
    

    我认为你的 dyno 可能是 alseep。您可以通过运行检查其状态:

    $ heroku ps
    

    但是,部署过程中的java.net.SocketException 令人担忧。但看起来确实部署成功了。

    【讨论】:

      猜你喜欢
      • 2023-04-08
      • 2013-03-27
      • 2012-05-08
      • 2020-08-15
      • 1970-01-01
      • 2014-05-30
      • 2019-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多