Heroku部署JAVA Maven dyno未运行。

huangapple go评论67阅读模式
英文:

Heroku deploy JAVA Maven dyno not running

问题

我有一个JAVA应用程序,在本地运行时完美运行。我使用IntelliJ IDEA IDE和Heroku部署配置,使用以下命令 heroku:deploy,我还有一个带有以下片段的pom.xml文件:

<build>
    <plugins>
        <plugin>
            <groupId>com.heroku.sdk</groupId>
            <artifactId>heroku-maven-plugin</artifactId>
            <version>3.0.3</version>
            <configuration>
                <appName>discord-bot-uskompuf</appName>
                <processTypes>
                    <web>java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes:target/dependency/* Bot</web>
                </processTypes>
            </configuration>
        </plugin>
    </plugins>
</build>

我的启动代码是 <web>java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes:target/dependency/* Bot</web>

我的主类名为Bot,当我尝试编译并部署到Heroku时,应用程序成功编译并上传到Heroku,我收到了构建成功的消息。在我的Heroku仪表板上,我可以看到我的dyn0 web java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes:target/dependency/* Bot,但它总是显示为关闭状态。查看Heroku日志只显示我的构建成功的消息。

我在这里漏掉了什么?

英文:

I have a JAVA application which works perfectly when running locally. I am using IntelliJ IDEA IDE and the Heroku deploy configuration with the following command heroku:deploy, I also have a pom.xml file with the following snippet:

    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;com.heroku.sdk&lt;/groupId&gt;
                &lt;artifactId&gt;heroku-maven-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.0.3&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;appName&gt;discord-bot-uskompuf&lt;/appName&gt;
                    &lt;processTypes&gt;
                        &lt;web&gt;java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes:target/dependency/* Bot&lt;/web&gt;
                    &lt;/processTypes&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;

My starting code is &lt;web&gt;java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes:target/dependency/* Bot&lt;/web&gt;

My main class is named Bot, when I go to compile to Heroku deploy the application successfully compiles and gets uploaded to Heroku and I receive a build success message. On my Heroku dashboard, I can see my dyn0 web java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes:target/dependency/* Bot however it is always listed as OFF. Looking at Heroku logs just shows that my build has succeeded.

What am I missing here?

答案1

得分: 3

我必须在Heroku上启用动态资源。

英文:

I had to enable dyno on heroku

huangapple
  • 本文由 发表于 2020年8月9日 16:56:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/63324376.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定