spring-boot-demo

you need to see spring-boot firstly.:smile:

build and run

build the project

mvn clean install -DskipTests

Running as a packaged application

if you want to deploy the project , you can do this: (must install jdk1.8 and config the environment of JAVA_HOME)

  • run
java -jar biz-demo/target/biz-demo.war
  • debugging.Then, you can use the remote debugging.
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar biz-demo/target/biz-demo.war

Or using the Maven plugin to running

you should execute first:

cd biz-demo

then execute:

mvn spring-boot:run

last, use browser to go http://localhost:8080/user/1 or http://127.0.0.1:8080/user/1

deploy to tomcat with maven

see use maven to deploy this project

1. start tomcat server

%TOMCAT_HOME%\bin\start.bat

2.deploy

first deploy

mvn tomcat7:deploy

redeploy

mvn tomcat7:redeploy

Tips

if you want to look the dependency tree of this project:

mvn dependency:tree

Introduce

Swagger

see https://springfox.github.io/springfox/ to learn more.

Swagger使用总结

RESTful API 利器 Swagger

Swagger:Rest API的描述语言 #####swagger-ui When you running the project with swagger , you can visit http://localhost:8080/swagger-ui.html#/. Then input the swagger http api:http://localhost:8080/v2/api-docs.