我已经使用 spring boot 编写了 web 服务。 当我运行它时,它只是作为 JVM 进行构建和运行
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringTestApplication {
public static void main(String[] args) {
SpringApplication.run(SpringTestApplication.class, args);
}
}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.6.RELEASE)
2019-07-10 09:25:01.964 INFO 683 --- [ main] com.example.demo.SpringTestApplication : Starting SpringTestApplication on Amits-MacBook-Air.local with PID 683 (/Users/amitpatil/Downloads/demo/target/classes started by amitpatil in /Users/amitpatil/Downloads/demo)
2019-07-10 09:25:01.967 INFO 683 --- [ main] com.example.demo.SpringTestApplication : No active profile set, falling back to default profiles: default
2019-07-10 09:25:03.298 INFO 683 --- [ main] com.example.demo.SpringTestApplication : Started SpringTestApplication in 7.067 seconds (JVM running for 7.826)
Process finished with exit code 0
最佳答案
说 Process finished with exit code 0
意味着一切正常ok。如果程序中发生异常或以其他方式生成带有非零参数的退出。
我推荐使用 Spring Initializr使用 embedded tomcat
引导您的 spring boot 应用程序。此外,我建议使用 Intelliju IDE
来处理您的应用程序。这应该可以轻松启动您的应用程序开发。
关于maven - Spring Boot应用程序没有启动tomcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56963203/