1
1
# spring-boot-demo
2
+
2
3
![ ] ( https://img.shields.io/static/v1?label=java&message=1.8&color=blue )
3
4
![ ] ( https://img.shields.io/static/v1?label=spring-boot&message=2.4.5.RELEASE&color=blue )
4
5
![ ] ( https://img.shields.io/static/v1?label=spring-restdocs&message=2.0.4.RELEASE&color=blue )
5
6
![ ] ( https://img.shields.io/static/v1?label=junit&message=4.13.2&color=black )
6
7
![ ] ( https://img.shields.io/static/v1?label=hibernate-validator&message=6.1.7.Final&color=blue )
8
+
7
9
* use spring-boot 2.x
8
10
* https://shields.io/
9
11
* [ github source] ( https://github.com/netbuffer/spring-boot-demo )
10
12
* [ gitee source] ( https://gitee.com/netbuffer/spring-boot-demo )
11
13
* /actuator/health
14
+ * [ spring-boot-2.4.5-reference] ( https://docs.spring.io/spring-boot/docs/2.4.5/reference/htmlsingle/ )
12
15
* [ @ControllerAdvice ] ( https://docs.spring.io/spring-framework/docs/5.3.6/reference/html/web.html#mvc-ann-controller-advice )
13
16
* [ Exceptions Process] ( https://docs.spring.io/spring-framework/docs/5.3.6/reference/html/web.html#mvc-ann-exceptionhandler )
14
17
* [ ResponseEntityExceptionHandler] ( https://docs.spring.io/spring-framework/docs/5.3.6/javadoc-api/org/springframework/web/servlet/mvc/method/annotation/ResponseEntityExceptionHandler.html )
15
18
* [ requestmapping] ( https://docs.spring.io/spring-framework/docs/5.3.6/reference/html/web.html#mvc-ann-requestmapping-registration )
19
+ * [ mvc-sse] ( https://docs.spring.io/spring-framework/docs/5.3.6/reference/html/web.html#mvc-ann-async-sse )
16
20
* [ hibernate_validator_reference] ( https://docs.jboss.org/hibernate/validator/6.2/reference/en-US/pdf/hibernate_validator_reference.pdf#validator-gettingstarted )
17
21
* https://docs.docker.com/compose/compose-file/compose-file-v3/#build
18
22
* https://hub.docker.com/_/openjdk
19
23
20
24
### server.servlet.session.timeout
25
+
21
26
``` html
22
27
ns for nanoseconds
23
28
us for microseconds
@@ -29,14 +34,17 @@ d for days
29
34
```
30
35
31
36
### mvn build test
32
- > ` mvn -Dmvn-arg=your param -DskipTests clean package -P test `
33
- -Dparam,-Pyour profile
37
+
38
+ > ` mvn -Dmvn-arg=your param -DskipTests clean package -P test `
39
+ > -Dparam,-Pyour profile
34
40
35
41
### maven-help-plugin use
42
+
36
43
* ` mvn help:system ` Displays a list of the platform details like system properties and environment variables
37
44
* ` mvn help:help ` Display help information on maven-help-plugin.Call mvn help: help -Ddetail=true -Dgoal=<goal-name > to display parameter details
38
45
39
46
### branch
47
+
40
48
* javamelody
41
49
* spring-restdocs
42
50
* templating-maven-plugin
@@ -46,27 +54,33 @@ d for days
46
54
### docker镜像制作
47
55
48
56
#### 构建
57
+
49
58
1 . 先通过maven打包到target目录下
50
- 2 . 执行构建指令:` cd target;docker build -f ../Dockerfile -t netbuffer/spring-boot-demo:1.0 ../ ` (` docker build -t netbuffer/spring-boot-demo:1.0 . ` )
59
+ 2 . 执行构建指令:` cd target;docker build -f ../Dockerfile -t netbuffer/spring-boot-demo:1.0 ../ ` (` docker build -t netbuffer/spring-boot-demo:1.0 . ` )
51
60
52
61
#### 运行
62
+
53
63
* docker run --rm -it -p 9100:9100 netbuffer/spring-boot-demo:1.0
54
64
* docker-compose up (使用docker-compose启动服务)
55
65
56
66
#### 发布到DockerHub
67
+
57
68
> 需要注册DockerHub身份,再docker login登录对应的Registry
69
+
58
70
1 . docker images 找到镜像ID
59
71
2 . docker tag 镜像ID 你的DockerHub账户名/spring-boot-demo:1.0 打tag
60
72
3 . docker push 你的DockerHub账户名/spring-boot-demo:1.0 推送到远程
61
73
62
74
#### 远程镜像
63
- > 已发布到DockerHub,可以直接运行以下指令测试
64
- https://hub.docker.com/r/javawiki/spring-boot-demo
75
+
76
+ > 已发布到DockerHub,可以直接运行以下指令测试
77
+ > https://hub.docker.com/r/javawiki/spring-boot-demo
65
78
66
79
* docker pull javawiki/spring-boot-demo:1.0 拉取远程镜像
67
80
* docker run -it --rm javawiki/spring-boot-demo:1.0 运行远程镜像
68
81
69
82
### articles
83
+
70
84
* [ spring-boot中统一修改http响应体内容的方法] ( https://www.toutiao.com/i7014375995448820231 )
71
85
* [ spring-boot中异常的处理] ( https://www.toutiao.com/i7014369292791579148 )
72
86
* [ 关于spring-boot中logback日志配置引用spring环境变量的使用方式] ( https://www.toutiao.com/i7014368145578230304 )
@@ -76,4 +90,4 @@ https://hub.docker.com/r/javawiki/spring-boot-demo
76
90
* [ 获取SpringBoot工程运行时的操作系统进程ID方法] ( https://www.toutiao.com/i7015456367477522977 )
77
91
* [ SpringBoot使用基于json格式的配置方法] ( https://www.toutiao.com/i7016209186543469069 )
78
92
* [ 怎么查看SpringBoot工程中每个过滤器的执行顺序] ( https://www.toutiao.com/i7016666337527382532 )
79
- * [ Spring中出现NoUniqueBeanDefinitionException的解决方法] ( https://www.toutiao.com/i7018897444583113247 )
93
+ * [ Spring中出现NoUniqueBeanDefinitionException的解决方法] ( https://www.toutiao.com/i7018897444583113247 )
0 commit comments