Skip to content

Commit

Permalink
refactor: 项目整理
Browse files Browse the repository at this point in the history
  • Loading branch information
dunwu committed May 13, 2021
1 parent 4a8ef06 commit dba117d
Show file tree
Hide file tree
Showing 12 changed files with 183 additions and 91 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<p align="center">
<a href="https://dunwu.github.io/java-tutorial/" target="_blank" rel="noopener noreferrer">
<img src="http://dunwu.test.upcdn.net/common/logo/dunwu-logo.png" alt="logo" width="150px"/>
<img src="https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png" alt="logo" width="150px"/>
</a>
</p>

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

<h1 align="center">JavaTutorial</h1>
Expand Down
187 changes: 136 additions & 51 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,147 @@
* @see https://vuepress.vuejs.org/zh/
*/
module.exports = {
port: "4000",
dest: "dist",
base: "/java-tutorial/",
title: "JAVA-TUTORIAL",
description: "Java 教程",
head: [["link", {rel: "icon", href: `/favicon.ico`}]],
port: '4000',
dest: 'dist',
base: '/java-tutorial/',
title: 'JAVA-TUTORIAL',
description: 'Java 教程',
head: [['link', { rel: 'icon', href: `/favicon.ico` }]],
markdown: {
externalLinks: {
target: "_blank", rel: "noopener noreferrer"
}
target: '_blank',
rel: 'noopener noreferrer',
},
},
themeConfig: {
logo: "images/dunwu-logo-100.png",
repo: "dunwu/java-tutorial",
repoLabel: "Github",
docsDir: "docs",
docsBranch: "master",
logo: 'https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png',
repo: 'dunwu/java-tutorial',
repoLabel: 'Github',
docsDir: 'docs',
docsBranch: 'master',
editLinks: true,
smoothScroll: true,
locales: {
"/": {
label: "简体中文", selectText: "Languages", editLinkText: "帮助我们改善此页面!", lastUpdated: "上次更新", nav: [{
text: "工具", link: "/javatool/", items: [{
text: "构建", link: "/javatool/build/"
}, {
text: "IDE", link: "/javatool/ide/"
}, {
text: "监控", link: "/javatool/monitor/"
}]
}, {
text: "JavaEE", link: "/javaee/"
}, {
text: "✨ Java系列", ariaLabel: "Java", items: [{
text: "Java 教程 📚", link: "https://dunwu.github.io/java-tutorial/", target: "_blank", rel: ""
}, {
text: "JavaCore 教程 📚", link: "https://dunwu.github.io/javacore/", target: "_blank", rel: ""
}, {
text: "JavaTech 教程 📚", link: "https://dunwu.github.io/javatech/", target: "_blank", rel: ""
}, {
text: "Spring 教程 📚", link: "https://dunwu.github.io/spring-tutorial/", target: "_blank", rel: ""
}, {
text: "Spring Boot 教程 📚", link: "https://dunwu.github.io/spring-boot-tutorial/", target: "_blank", rel: ""
}]
}, {
text: "🎯 博客", link: "https://github.com/dunwu/blog", target: "_blank", rel: ""
}], sidebar: "auto", sidebarDepth: 2
}
}
'/': {
label: '简体中文',
selectText: 'Languages',
editLinkText: '帮助我们改善此页面!',
lastUpdated: '上次更新',
nav: [
{
text: '工具',
link: '/javatool/',
items: [
{
text: '构建',
link: '/javatool/build/',
},
{
text: 'IDE',
link: '/javatool/ide/',
},
{
text: '监控',
link: '/javatool/monitor/',
},
],
},
{
text: 'JavaEE',
link: '/javaee/',
},
{
text: '✨ Java系列',
ariaLabel: 'Java',
items: [
{
text: 'Java 教程 📚',
link: 'https://dunwu.github.io/java-tutorial/',
target: '_blank',
rel: '',
},
{
text: 'JavaCore 教程 📚',
link: 'https://dunwu.github.io/javacore/',
target: '_blank',
rel: '',
},
{
text: 'JavaTech 教程 📚',
link: 'https://dunwu.github.io/javatech/',
target: '_blank',
rel: '',
},
{
text: 'Spring 教程 📚',
link: 'https://dunwu.github.io/spring-tutorial/',
target: '_blank',
rel: '',
},
{
text: 'Spring Boot 教程 📚',
link: 'https://dunwu.github.io/spring-boot-tutorial/',
target: '_blank',
rel: '',
},
],
},
{
text: '🎯 博客',
link: 'https://github.com/dunwu/blog',
target: '_blank',
rel: '',
},
],
sidebar: 'auto',
sidebarDepth: 2,
},
},
},
plugins: [["@vuepress/active-header-links", {
sidebarLinkSelector: ".sidebar-link", headerAnchorSelector: ".header-anchor"
}], ["@vuepress/back-to-top", true], ["@vuepress/pwa", {
serviceWorker: true, updatePopup: true
}], ["@vuepress/medium-zoom", true], ["container", {
type: "vue", before: '<pre class="vue-container"><code>', after: "</code></pre>"
}], ["container", {
type: "upgrade", before: info => `<UpgradePath title="${info}">`, after: "</UpgradePath>"
}], ["flowchart"]]
};
plugins: [
[
'@vuepress/active-header-links',
{
sidebarLinkSelector: '.sidebar-link',
headerAnchorSelector: '.header-anchor',
},
],
['@vuepress/back-to-top', true],
[
'@vuepress/pwa',
{
serviceWorker: true,
updatePopup: true,
},
],
[
'@vuepress/last-updated',
{
transformer: (timestamp, lang) => {
// 不要忘了安装 moment
const moment = require('moment')
moment.locale(lang)
return moment(timestamp).fromNow()
},
},
],
['@vuepress/medium-zoom', true],
[
'container',
{
type: 'vue',
before: '<pre class="vue-container"><code>',
after: '</code></pre>',
},
],
[
'container',
{
type: 'upgrade',
before: (info) => `<UpgradePath title="${info}">`,
after: '</UpgradePath>',
},
],
['flowchart'],
],
}
5 changes: 4 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
home: true
heroImage: http://dunwu.test.upcdn.net/common/logo/dunwu-logo.png
heroImage: https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo-200.png
heroText: JAVA-TUTORIAL
tagline: ☕ java-tutorial 是一个 Java 教程,汇集一个老司机在 Java 领域的十年积累。
actionLink: /
footer: CC-BY-SA-4.0 Licensed | Copyright © 2018-Now Dunwu
---

![license](https://badgen.net/github/license/dunwu/java-tutorial)
![build](https://travis-ci.com/dunwu/java-tutorial.svg?branch=master)

> **java-tutorial** 是一个 Java 教程,汇集一个老司机在 Java 领域的十年积累。
>
> - 🔁 项目同步维护:[Github](https://github.com/dunwu/java-tutorial/) | [Gitee](https://gitee.com/turnon/java-tutorial/)
Expand Down
2 changes: 1 addition & 1 deletion docs/javaee/javaee-filter-listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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

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

### 1.1. 过滤器方法

Expand Down
8 changes: 4 additions & 4 deletions docs/javatool/build/maven/maven-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ maven 的 JDK 源与指定的 JDK 编译版本不符。

Project SDK 是否正确

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

SDK 路径是否正确

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

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

JDK for importer 是否正确

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

Runner 是否正确

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

### 重复引入依赖

Expand Down
8 changes: 4 additions & 4 deletions docs/javatool/build/maven/maven-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

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

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

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

Expand Down Expand Up @@ -309,7 +309,7 @@ gpg: unchanged: 1

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

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

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

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

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

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

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

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

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

> 说明:
>
Expand Down
22 changes: 11 additions & 11 deletions docs/javatool/build/maven/maven-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export PATH=$MAVEN_HOME/bin:$PATH

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

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

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

### 检测安装成功

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

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

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

(2)输入项目信息

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

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

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

### 在 Eclipse 中创建 Maven 工程

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

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

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

(2)Maven 环境配置

点击 Window -> Preferences

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

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

(3)创建 Maven 工程

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

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

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

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

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

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

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

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

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

Maven 命令构建方式:

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

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

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

## 四、使用说明

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

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

## CAT 部署

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

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

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

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

Expand Down
Loading

0 comments on commit dba117d

Please sign in to comment.