此时,应用程序应该可以工作了。由于在POM文件中使用了spring-boot-starter-parent,因此有一个有用的run目标,它可以用来启动应用程序。从项目的根目录键入mvn spring-boot:run以启动应用程序。
您应该看到类似于以下内容的输出:
$ mvn spring-boot:run. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v2.4.0-SNAPSHOT)....... . . ........ . . . (log output here)....... . . ......... Started Example in 2.222 seconds (JVM running for 6.514)
如果在Web浏览器打开[localhost:8080](http://localhost:8080/)地址,应该看到以下输出:
Hello World!
要正常退出该应用程序,请按ctrl-c。
