SpringBoot官方文档翻译(九):运行示例

11.4 Running the Example(运行示例)

1
2
3
4
5
At this point, your application should work. Since you used the     
spring-boot-starter-parent POM, you have a useful run goal that you
can use to start the application. Type mvn spring-boot:run from the
root project directory to start the application. You should see output
similar to the following:

此时,您的应用程序应该可以工作了。由于使用了spring-boot-starter-parent POM,所以您有一个可用的运行目标,可以用来启动应用程序。在工程的根木兰路下输入mvn spring-boot:run启动应用。您应该看到类似于以下的输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
$ mvn spring-boot:run

. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.0.BUILD-SNAPSHOT)
....... . . .
....... . . . (log output here)
....... . . .
........ Started Example in 2.222 seconds (JVM running for 6.514)

1
2
If you open a web browser to localhost:8080, you should see     
the following output:

如果您打开一个web浏览器输入localhost:8080,您将会看到如下的输出:

1
Hello World!
1
To gracefully exit the application, press ctrl-c.

优雅退出请按ctrl+c

分享到