Skip to content

Commit dba117d

Browse files
committed
refactor: 项目整理
1 parent 4a8ef06 commit dba117d

File tree

12 files changed

+183
-91
lines changed

12 files changed

+183
-91
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<p align="center">
22
<a href="https://dunwu.github.io/java-tutorial/" target="_blank" rel="noopener noreferrer">
3-
<img src="http://dunwu.test.upcdn.net/common/logo/dunwu-logo.png" alt="logo" width="150px"/>
3+
<img src="https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png" alt="logo" width="150px"/>
44
</a>
55
</p>
66

77
<p align="center">
88
<img src="https://badgen.net/github/license/dunwu/java-tutorial" alt="license">
9+
<img src="https://travis-ci.com/dunwu/java-tutorial.svg?branch=master" alt="build">
910
</p>
1011

1112
<h1 align="center">JavaTutorial</h1>

docs/.vuepress/config.js

Lines changed: 136 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,147 @@
22
* @see https://vuepress.vuejs.org/zh/
33
*/
44
module.exports = {
5-
port: "4000",
6-
dest: "dist",
7-
base: "/java-tutorial/",
8-
title: "JAVA-TUTORIAL",
9-
description: "Java 教程",
10-
head: [["link", {rel: "icon", href: `/favicon.ico`}]],
5+
port: '4000',
6+
dest: 'dist',
7+
base: '/java-tutorial/',
8+
title: 'JAVA-TUTORIAL',
9+
description: 'Java 教程',
10+
head: [['link', { rel: 'icon', href: `/favicon.ico` }]],
1111
markdown: {
1212
externalLinks: {
13-
target: "_blank", rel: "noopener noreferrer"
14-
}
13+
target: '_blank',
14+
rel: 'noopener noreferrer',
15+
},
1516
},
1617
themeConfig: {
17-
logo: "images/dunwu-logo-100.png",
18-
repo: "dunwu/java-tutorial",
19-
repoLabel: "Github",
20-
docsDir: "docs",
21-
docsBranch: "master",
18+
logo: 'https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png',
19+
repo: 'dunwu/java-tutorial',
20+
repoLabel: 'Github',
21+
docsDir: 'docs',
22+
docsBranch: 'master',
2223
editLinks: true,
2324
smoothScroll: true,
2425
locales: {
25-
"/": {
26-
label: "简体中文", selectText: "Languages", editLinkText: "帮助我们改善此页面!", lastUpdated: "上次更新", nav: [{
27-
text: "工具", link: "/javatool/", items: [{
28-
text: "构建", link: "/javatool/build/"
29-
}, {
30-
text: "IDE", link: "/javatool/ide/"
31-
}, {
32-
text: "监控", link: "/javatool/monitor/"
33-
}]
34-
}, {
35-
text: "JavaEE", link: "/javaee/"
36-
}, {
37-
text: "✨ Java系列", ariaLabel: "Java", items: [{
38-
text: "Java 教程 📚", link: "https://dunwu.github.io/java-tutorial/", target: "_blank", rel: ""
39-
}, {
40-
text: "JavaCore 教程 📚", link: "https://dunwu.github.io/javacore/", target: "_blank", rel: ""
41-
}, {
42-
text: "JavaTech 教程 📚", link: "https://dunwu.github.io/javatech/", target: "_blank", rel: ""
43-
}, {
44-
text: "Spring 教程 📚", link: "https://dunwu.github.io/spring-tutorial/", target: "_blank", rel: ""
45-
}, {
46-
text: "Spring Boot 教程 📚", link: "https://dunwu.github.io/spring-boot-tutorial/", target: "_blank", rel: ""
47-
}]
48-
}, {
49-
text: "🎯 博客", link: "https://github.com/dunwu/blog", target: "_blank", rel: ""
50-
}], sidebar: "auto", sidebarDepth: 2
51-
}
52-
}
26+
'/': {
27+
label: '简体中文',
28+
selectText: 'Languages',
29+
editLinkText: '帮助我们改善此页面!',
30+
lastUpdated: '上次更新',
31+
nav: [
32+
{
33+
text: '工具',
34+
link: '/javatool/',
35+
items: [
36+
{
37+
text: '构建',
38+
link: '/javatool/build/',
39+
},
40+
{
41+
text: 'IDE',
42+
link: '/javatool/ide/',
43+
},
44+
{
45+
text: '监控',
46+
link: '/javatool/monitor/',
47+
},
48+
],
49+
},
50+
{
51+
text: 'JavaEE',
52+
link: '/javaee/',
53+
},
54+
{
55+
text: '✨ Java系列',
56+
ariaLabel: 'Java',
57+
items: [
58+
{
59+
text: 'Java 教程 📚',
60+
link: 'https://dunwu.github.io/java-tutorial/',
61+
target: '_blank',
62+
rel: '',
63+
},
64+
{
65+
text: 'JavaCore 教程 📚',
66+
link: 'https://dunwu.github.io/javacore/',
67+
target: '_blank',
68+
rel: '',
69+
},
70+
{
71+
text: 'JavaTech 教程 📚',
72+
link: 'https://dunwu.github.io/javatech/',
73+
target: '_blank',
74+
rel: '',
75+
},
76+
{
77+
text: 'Spring 教程 📚',
78+
link: 'https://dunwu.github.io/spring-tutorial/',
79+
target: '_blank',
80+
rel: '',
81+
},
82+
{
83+
text: 'Spring Boot 教程 📚',
84+
link: 'https://dunwu.github.io/spring-boot-tutorial/',
85+
target: '_blank',
86+
rel: '',
87+
},
88+
],
89+
},
90+
{
91+
text: '🎯 博客',
92+
link: 'https://github.com/dunwu/blog',
93+
target: '_blank',
94+
rel: '',
95+
},
96+
],
97+
sidebar: 'auto',
98+
sidebarDepth: 2,
99+
},
100+
},
53101
},
54-
plugins: [["@vuepress/active-header-links", {
55-
sidebarLinkSelector: ".sidebar-link", headerAnchorSelector: ".header-anchor"
56-
}], ["@vuepress/back-to-top", true], ["@vuepress/pwa", {
57-
serviceWorker: true, updatePopup: true
58-
}], ["@vuepress/medium-zoom", true], ["container", {
59-
type: "vue", before: '<pre class="vue-container"><code>', after: "</code></pre>"
60-
}], ["container", {
61-
type: "upgrade", before: info => `<UpgradePath title="${info}">`, after: "</UpgradePath>"
62-
}], ["flowchart"]]
63-
};
102+
plugins: [
103+
[
104+
'@vuepress/active-header-links',
105+
{
106+
sidebarLinkSelector: '.sidebar-link',
107+
headerAnchorSelector: '.header-anchor',
108+
},
109+
],
110+
['@vuepress/back-to-top', true],
111+
[
112+
'@vuepress/pwa',
113+
{
114+
serviceWorker: true,
115+
updatePopup: true,
116+
},
117+
],
118+
[
119+
'@vuepress/last-updated',
120+
{
121+
transformer: (timestamp, lang) => {
122+
// 不要忘了安装 moment
123+
const moment = require('moment')
124+
moment.locale(lang)
125+
return moment(timestamp).fromNow()
126+
},
127+
},
128+
],
129+
['@vuepress/medium-zoom', true],
130+
[
131+
'container',
132+
{
133+
type: 'vue',
134+
before: '<pre class="vue-container"><code>',
135+
after: '</code></pre>',
136+
},
137+
],
138+
[
139+
'container',
140+
{
141+
type: 'upgrade',
142+
before: (info) => `<UpgradePath title="${info}">`,
143+
after: '</UpgradePath>',
144+
},
145+
],
146+
['flowchart'],
147+
],
148+
}

docs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
---
22
home: true
3-
heroImage: http://dunwu.test.upcdn.net/common/logo/dunwu-logo.png
3+
heroImage: https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png
44
heroText: JAVA-TUTORIAL
55
tagline: ☕ java-tutorial 是一个 Java 教程,汇集一个老司机在 Java 领域的十年积累。
66
actionLink: /
77
footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu
88
---
99

10+
![license](https://badgen.net/github/license/dunwu/java-tutorial)
11+
![build](https://travis-ci.com/dunwu/java-tutorial.svg?branch=master)
12+
1013
> **java-tutorial** 是一个 Java 教程,汇集一个老司机在 Java 领域的十年积累。
1114
>
1215
> - 🔁 项目同步维护:[Github](https://github.com/dunwu/java-tutorial/) | [Gitee](https://gitee.com/turnon/java-tutorial/)

docs/javaee/javaee-filter-listener.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
Filter 提供了过滤链(Filter Chain)的概念,一个过滤链包括多个 Filter。客户端请求 request 在抵达 Servlet 之前会经过过滤链的所有 Filter,服务器响应 response 从 Servlet 抵达客户端浏览器之前也会经过过滤链的所有 FIlter。
2626

27-
![img](http://dunwu.test.upcdn.net/snap/1559054413341.png)
27+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/1559054413341.png)
2828

2929
### 1.1. 过滤器方法
3030

docs/javatool/build/maven/maven-action.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ maven 的 JDK 源与指定的 JDK 编译版本不符。
5353

5454
Project SDK 是否正确
5555

56-
![img](http://dunwu.test.upcdn.net/snap/20181127203324.png!zp)
56+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203324.png)
5757

5858
SDK 路径是否正确
5959

60-
![img](http://dunwu.test.upcdn.net/snap/20181127203427.png!zp)
60+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203427.png)
6161

6262
- **查看 Settings > Maven 的配置**
6363

6464
JDK for importer 是否正确
6565

66-
![img](http://dunwu.test.upcdn.net/snap/20181127203408.png!zp)
66+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203408.png)
6767

6868
Runner 是否正确
6969

70-
![img](http://dunwu.test.upcdn.net/snap/20181127203439.png!zp)
70+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203439.png)
7171

7272
### 重复引入依赖
7373

docs/javatool/build/maven/maven-deploy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
注册账号成功后,根据你 Java 包的功能分别写上`Summary``Description``Group Id``SCM url`以及`Project URL`等必要信息,可以参见我之前创建的 Issue:[OSSRH-36187](https://issues.sonatype.org/browse/OSSRH-36187)
3535

36-
![img](http://dunwu.test.upcdn.net/snap/20181106143734.png!zp)
36+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181106143734.png)
3737

3838
创建完之后需要等待 Sonatype 的工作人员审核处理,审核时间还是很快的,我的审核差不多等待了两小时。当 Issue 的 Status 变为`RESOLVED`后,就可以进行下一步操作了。
3939

@@ -309,7 +309,7 @@ gpg: unchanged: 1
309309

310310
进入[官方下载地址](https://www.sonatype.com/download-oss-sonatype),选择合适版本下载。
311311

312-
![img](http://dunwu.test.upcdn.net/snap/20181127203029.png!zp)
312+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203029.png)
313313

314314
本人希望将 Nexus 部署在 Linux 机器,所以选用的是 Unix 版本。
315315

@@ -341,13 +341,13 @@ Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload}
341341

342342
启动成功后,在浏览器中访问 `http://<ip>:8081`,欢迎页面如下图所示:
343343

344-
![img](http://dunwu.test.upcdn.net/snap/20181127203131.png!zp)
344+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203131.png)
345345

346346
点击右上角 Sign in 登录,默认用户名/密码为:admin/admin123。
347347

348348
有必要提一下的是,在 Nexus 的 Repositories 管理页面,展示了可用的 maven 仓库,如下图所示:
349349

350-
![img](http://dunwu.test.upcdn.net/snap/20181127203156.png!zp)
350+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127203156.png)
351351

352352
> 说明:
353353
>

docs/javatool/build/maven/maven-quickstart.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ export PATH=$MAVEN_HOME/bin:$PATH
150150

151151
右键 "计算机",选择 "属性",之后点击 "高级系统设置",点击"环境变量",来设置环境变量,有以下系统变量需要配置:
152152

153-
![img](http://dunwu.test.upcdn.net/snap/20200108143017.png)
153+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200108143017.png)
154154

155-
![img](http://dunwu.test.upcdn.net/snap/20200108143038.png)
155+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200108143038.png)
156156

157157
### 检测安装成功
158158

@@ -280,15 +280,15 @@ java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
280280

281281
依次点击 File -> New -> Project 打开创建工程对话框,选择 Maven 工程。
282282

283-
![img](http://dunwu.test.upcdn.net/snap/1555414103572.png!zp)
283+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/1555414103572.png)
284284

285285
(2)输入项目信息
286286

287-
![img](http://dunwu.test.upcdn.net/snap/1555415549748.png!zp)
287+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/1555415549748.png)
288288

289289
(3)点击 Intellij 侧边栏中的 Maven 工具界面,有几个可以直接使用的 maven 命令,可以帮助你进行构建。
290290

291-
![img](http://dunwu.test.upcdn.net/snap/1555415806237.png!zp)
291+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/1555415806237.png)
292292

293293
### 在 Eclipse 中创建 Maven 工程
294294

@@ -300,23 +300,23 @@ java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
300300

301301
点击 Help -> Eclipse Marketplace,搜索 maven 关键字,选择安装红框对应的 Maven 插件。
302302

303-
![img](http://dunwu.test.upcdn.net/snap/20181127195117.png!zp)
303+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127195117.png)
304304

305305
(2)Maven 环境配置
306306

307307
点击 Window -> Preferences
308308

309309
如下图所示,配置 settings.xml 文件的位置
310310

311-
![img](http://dunwu.test.upcdn.net/snap/20181127195128.png!zp)
311+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127195128.png)
312312

313313
(3)创建 Maven 工程
314314

315315
File -> New -> Maven Project -> Next,在接下来的窗口中会看到一大堆的项目模板,选择合适的模板。
316316

317317
接下来设置项目的参数,如下:
318318

319-
![img](http://dunwu.test.upcdn.net/snap/20181127195151.png!zp)
319+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127195151.png)
320320

321321
**groupId**是项目组织唯一的标识符,实际对应 JAVA 的包的结构,是 main 目录里 java 的目录结构。
322322

@@ -330,19 +330,19 @@ Eclipse 中构建方式:
330330

331331
在 Elipse 项目上右击 -> Run As 就能看到很多 Maven 操作。这些操作和 maven 命令是等效的。例如 Maven clean,等同于 mvn clean 命令。
332332

333-
![img](http://dunwu.test.upcdn.net/snap/20181127195208.png!zp)
333+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127195208.png)
334334

335335
你也可以点击 Maven build,输入组合命令,并保存下来。如下图:
336336

337-
![img](http://dunwu.test.upcdn.net/snap/20181127195219.png!zp)
337+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127195219.png)
338338

339339
Maven 命令构建方式:
340340

341341
当然,你也可以直接使用 maven 命令进行构建。
342342

343343
进入工程所在目录,输入 maven 命令就可以了。
344344

345-
![img](http://dunwu.test.upcdn.net/snap/20181127195243.png!zp)
345+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20181127195243.png)
346346

347347
## 四、使用说明
348348

docs/javatool/monitor/cat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CAT监控系统将每次URL、Service的请求内部执行情况都封装为一
2222
- **Heartbeat** 表示程序内定期产生的统计信息, 如 CPU 利用率, 内存利用率, 连接池状态, 系统负载等
2323
- **Metric** 用于记录业务指标、指标可能包含对一个指标记录次数、记录平均值、记录总和,业务指标最低统计粒度为 1 分钟
2424

25-
![img](http://dunwu.test.upcdn.net/snap/20200211174235.png)
25+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200211174235.png)
2626

2727
## CAT 部署
2828

@@ -57,7 +57,7 @@ CAT 主要分为三个模块:
5757

5858
在实际开发和部署中,cat-consumer 和 cat-home 是部署在一个 jvm 内部,每个 CAT 服务端都可以作为 consumer 也可以作为 home,这样既能减少整个 CAT 层级结构,也可以增加整个系统稳定性。
5959

60-
![img](http://dunwu.test.upcdn.net/snap/20200211174001.png)
60+
![img](https://raw.githubusercontent.com/dunwu/images/dev/snap/20200211174001.png)
6161

6262
上图是 CAT 目前多机房的整体结构图:
6363

0 commit comments

Comments
 (0)