使用heroku-maven-plugin – 崩溃的应用程序部署到Heroku的春季启动应用程序

我正在尝试使用Heroku Maven插件部署我的Spring Boot应用程序。 部署完成( mvn heroku:deploy )。 但是,当我检查Heroku的应用程序日志( heroku logs --tail ),我看到它没有找到主类:

 2017-10-03T23:50:45.702415+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -cp target/classes:target/dependency/* Main` 2017-10-03T23:50:48.064526+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them. 2017-10-03T23:50:48.068505+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -Dfile.encoding=UTF-8 2017-10-03T23:50:48.237240+00:00 app[web.1]: Error: Could not find or load main class Main 2017-10-03T23:50:48.314862+00:00 heroku[web.1]: State changed from starting to crashed 2017-10-03T23:50:48.301181+00:00 heroku[web.1]: Process exited with status 1 

我没有任何Procfile (依靠默认值)。 Heroku的Maven插件配置如下所示:

 <plugin> <groupId>com.heroku.sdk</groupId> <artifactId>heroku-maven-plugin</artifactId> <version>1.2.0</version> <configuration> <processTypes> <web>java $JAVA_OPTS -cp target/classes:target/dependency/* Main</web> </processTypes> </configuration> </plugin> 

主类路径是:

 BASEPROJDIR/src/main/kotlin/com/virtualstand/ExplorerApplication.kt 

您需要确保到主类的类路径是正确的: –

 <configuration> <processTypes> <web>java $JAVA_OPTS -cp target/classes:target/dependency/* com.virtualstand.ExplorerApplication</web> </processTypes> </configuration>