简体   繁体   English

将Spring Boot JAR应用程序转换为WAR

[英]Converting a Spring Boot JAR Application to a WAR

I have tried to run "Converting a Spring Boot JAR Application to a WAR" application by converting into a war package as instructed...and since it was mentioned that void main() is no longer needed,I removed it and tried to build it using gradle but it throws error unable to find main class. 我已经尝试按照指示将其转换为war包来运行“将Spring Boot JAR应用程序转换为WAR”应用程序...由于提到了不再需要void main(),因此我将其删除并尝试构建它使用gradle,但会引发无法找到主类的错误

The content of class after my modification is as below 我修改后的类内容如下

Application.java

@Configuration
@EnableAutoConfiguration
@ComponentScan
public class Application {

}

what is the mistake am I making? 我在犯什么错误?

If you don't want an executable war then remove the Spring Boot plugin. 如果您不想执行可执行文件,请删除Spring Boot插件。 If you do, leave it in, and keep the main(). 如果这样做,则将其保留,并保留main()。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM