Heroku-Spring Boot App-进程退出,状态为1

时间:2018-10-20 06:44:20

标签: spring-boot heroku

尝试运行“ hello world” Spring Boot应用程序(在本地运行正常),我收到此消息:

2018-10-20T06:32:21.827918+00:00 heroku[web.1]: State changed from crashed to starting
2018-10-20T06:32:24.676953+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=35016 $JAVA_OPTS -jar target/das-boot-0.0.1-SNAPSHOT.jar`
2018-10-20T06:32:27.138742+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2018-10-20T06:32:27.142496+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 
2018-10-20T06:32:27.266974+00:00 app[web.1]: no main manifest attribute, in target/das-boot-0.0.1-SNAPSHOT.jar
2018-10-20T06:32:27.324779+00:00 heroku[web.1]: Process exited with status 1
2018-10-20T06:32:27.343816+00:00 heroku[web.1]: State changed from starting to crashed

您可以在github上找到代码以了解更多详细信息(https://github.com/ricgonmen/das-boot)。

我尝试在有和没有Procfile的情况下运行它,但没有任何变化。我不知道如何获取有关崩溃的更多信息来解决它。有什么建议吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

这似乎是您的问题:no main manifest attribute, in target/das-boot-0.0.1-SNAPSHOT.jar

您可以尝试将其添加到pom.xml的插件部分吗?

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>2.0.6.RELEASE</version>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

更多信息可以在这里找到:Spring Boot Maven Plugin