如何 运行 a .war without a main class from command and heroku?

How to run a .war without a main class from command and heroku?

我有一个 spring mvc,maven CRUD webapp 没有主 class,也没有可执行文件 classes。 它有几个 .jsp 页面,当从 Controller class.

调用时 运行

它有 Appinitializer,我猜它使用 Spring MVC 来启动应用程序。它还有一个带有 Viewresolver 的 class,我猜它配置了控制器。我打包成 .war .

它 运行 在 tomcat localhost 上很好,但是当我尝试在命令行或 heroku 本地网络上 运行 它时,它一直要求主文件(没有主清单属性) .任何线索如何找到要执行的文件?我没有任何可执行文件 classes 或 main class.

这是应用初始化程序的样子:

您需要像在本地计算机上一样在 Heroku 上安装 Tomcat。 Heroku 为您的用例提供了一个解决方案,如下所述:https://devcenter.heroku.com/articles/java-webapp-runner