与嵌入式tomcat交战

我最近创建了一个使用spring mvc,gradle和tomcat托管的Web应用程序。我一直在尝试创建Web应用程序的war文件,该文件可以单独执行,而无需在计算机上安装gradle和tomcat。

For example running java -jar <path-to-war> and the server will be running on the localhost port specified.

解决此问题的最佳方法是什么?