Skip to content

Commit 81fe558

Browse files
committed
更新说明文档
1 parent 60da28e commit 81fe558

File tree

2 files changed

+105
-100
lines changed

2 files changed

+105
-100
lines changed

.gitignore

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
.settings
2-
.project
3-
target
4-
ganymed-spring-boot/.settings
5-
ganymed-spring-boot/.project
6-
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.settings
7-
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.project
8-
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.classpath
9-
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.factorypath
10-
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.apt_generated
11-
ganymed-spring-boot/ganymed-spring-boot-starter/.settings
12-
ganymed-spring-boot/ganymed-spring-boot-starter/.project
13-
ganymed-spring-boot/ganymed-spring-boot-starter/.classpath
14-
ganymed-spring-boot/ganymed-spring-boot-starter/.factorypath
15-
ganymed-spring-boot/ganymed-spring-boot-starter/.apt_generated
16-
jsch-spring-boot/.settings
17-
jsch-spring-boot/.project
18-
jsch-spring-boot/jsch-spring-boot-autoconfigure/.settings
19-
jsch-spring-boot/jsch-spring-boot-autoconfigure/.project
20-
jsch-spring-boot/jsch-spring-boot-autoconfigure/.classpath
21-
jsch-spring-boot/jsch-spring-boot-autoconfigure/.factorypath
22-
jsch-spring-boot/jsch-spring-boot-autoconfigure/.apt_generated
23-
jsch-spring-boot/jsch-spring-boot-starter/.settings
24-
jsch-spring-boot/jsch-spring-boot-starter/.project
25-
jsch-spring-boot/jsch-spring-boot-starter/.classpath
26-
jsch-spring-boot/jsch-spring-boot-starter/.factorypath
27-
jsch-spring-boot/jsch-spring-boot-starter/.apt_generated
28-
ssh2-spring-boot-sample/.settings
29-
ssh2-spring-boot-sample/.project
30-
ssh2-spring-boot-sample/.classpath
31-
ssh2-spring-boot-sample/.factorypath
32-
ssh2-spring-boot-sample/.apt_generated
33-
ssh2-spring-boot-sample/bin
1+
.settings
2+
.project
3+
target
4+
ganymed-spring-boot/.settings
5+
ganymed-spring-boot/.project
6+
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.settings
7+
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.project
8+
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.classpath
9+
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.factorypath
10+
ganymed-spring-boot/ganymed-spring-boot-autoconfigure/.apt_generated
11+
ganymed-spring-boot/ganymed-spring-boot-starter/.settings
12+
ganymed-spring-boot/ganymed-spring-boot-starter/.project
13+
ganymed-spring-boot/ganymed-spring-boot-starter/.classpath
14+
ganymed-spring-boot/ganymed-spring-boot-starter/.factorypath
15+
ganymed-spring-boot/ganymed-spring-boot-starter/.apt_generated
16+
jsch-spring-boot/.settings
17+
jsch-spring-boot/.project
18+
jsch-spring-boot/jsch-spring-boot-autoconfigure/.settings
19+
jsch-spring-boot/jsch-spring-boot-autoconfigure/.project
20+
jsch-spring-boot/jsch-spring-boot-autoconfigure/.classpath
21+
jsch-spring-boot/jsch-spring-boot-autoconfigure/.factorypath
22+
jsch-spring-boot/jsch-spring-boot-autoconfigure/.apt_generated
23+
jsch-spring-boot/jsch-spring-boot-starter/.settings
24+
jsch-spring-boot/jsch-spring-boot-starter/.project
25+
jsch-spring-boot/jsch-spring-boot-starter/.classpath
26+
jsch-spring-boot/jsch-spring-boot-starter/.factorypath
27+
jsch-spring-boot/jsch-spring-boot-starter/.apt_generated
28+
ssh2-spring-boot-sample/.settings
29+
ssh2-spring-boot-sample/.project
30+
ssh2-spring-boot-sample/.classpath
31+
ssh2-spring-boot-sample/.factorypath
32+
ssh2-spring-boot-sample/.apt_generated
33+
ssh2-spring-boot-sample/.springBeans
34+
ssh2-spring-boot-sample/bin
3435
ssh2-spring-boot-sample/target

README.md

Lines changed: 71 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,72 @@
1-
# ssh2-spring-boot
2-
现在很多创业公司都不再自建机房,更多地选择云主机,如阿里云和腾讯云等。为了安全考虑,他们提供的关系数据库、nosql数据库等服务器都是不能直接访问的,只能通过云主机访问。因此开发和测试会比较麻烦。
3-
4-
在Java环境中,可以使用[JSch](http://www.jcraft.com/jsch/)[GANYMED](https://www.cleondris.com/opensource/ssh2/)解决这个问题。本地程序通过JSch或GANYMED连接到云主机,通过端口转发访问云数据库等受限的服务器,相当于本地操作,很方便。
5-
6-
本项目为方便使用[JSch](http://www.jcraft.com/jsch/)[GANYMED](https://www.cleondris.com/opensource/ssh2/)而建,可以随意选择一种使用。
7-
8-
### 下载打包
9-
10-
```
11-
git clone https://github.com/nivance/ssh2-spring-boot.git
12-
```
13-
14-
因为没有将ssh-spring-boot放到任何maven公共仓库,所以需要将ssh-spring-boot的jar包安装到本地repository中。
15-
```
16-
cd ssh-spring-boot
17-
18-
mvn clean install
19-
20-
cd ganymed-spring-boot/ganymed-spring-boot-starter/target
21-
22-
mvn install:install-file -Dfile=ganymed-spring-boot-starter-1.0.0.jar \
23-
-DgroupId=ssh2.spring.boot \
24-
-DartifactId=ganymed-spring-boot-starter \
25-
-Dversion=1.0.0 \
26-
-Dpackaging=jar
27-
28-
cd ../../ganymed-spring-boot-autoconfigure/target
29-
30-
mvn install:install-file -Dfile=ganymed-spring-boot-autoconfigure-1.0.0.jar \
31-
-DgroupId=ssh2.spring.boot \
32-
-DartifactId=ganymed-spring-boot-autoconfigure \
33-
-Dversion=1.0.0 \
34-
-Dpackaging=jar
35-
36-
或者:---------------------------------------------------
37-
cd jsch-spring-boot/jsch-spring-boot-starter/target
38-
39-
mvn install:install-file -Dfile=jsch-spring-boot-starter-1.0.0.jar \
40-
-DgroupId=ssh2.spring.boot \
41-
-DartifactId=jsch-spring-boot-starter \
42-
-Dversion=1.0.0 \
43-
-Dpackaging=jar
44-
45-
cd ../../jsch-spring-boot-autoconfigure/target
46-
47-
mvn install:install-file -Dfile=jsch-spring-boot-autoconfigure-1.0.0.jar \
48-
-DgroupId=ssh2.spring.boot \
49-
-DartifactId=jsch-spring-boot-autoconfigure \
50-
-Dversion=1.0.0 \
51-
-Dpackaging=jar
52-
53-
```
54-
55-
### 引用(2选1)
56-
```
57-
<dependency>
58-
<groupId>ssh2.spring.boot</groupId>
59-
<artifactId>jsch-spring-boot-starter</artifactId>
60-
<version>1.0.0</version>
61-
</dependency>
62-
63-
<dependency>
64-
<groupId>ssh2.spring.boot</groupId>
65-
<artifactId>ganymed-spring-boot-starter</artifactId>
66-
<version>1.0.0</version>
67-
</dependency>
1+
# ssh2-spring-boot
2+
现在很多创业公司都不再自建机房,更多地选择云主机,如阿里云和腾讯云等。为了安全考虑,他们提供的关系数据库、nosql数据库等服务器都是不能直接访问的,只能通过云主机访问。因此开发和测试会比较麻烦。
3+
4+
在Java环境中,可以使用[JSch](http://www.jcraft.com/jsch/)[GANYMED](https://www.cleondris.com/opensource/ssh2/)解决这个问题。本地程序通过JSch或GANYMED连接到云主机,通过端口转发访问云数据库等受限的服务器,相当于本地操作,很方便。
5+
6+
本项目为方便使用[JSch](http://www.jcraft.com/jsch/)[GANYMED](https://www.cleondris.com/opensource/ssh2/)而建,可以随意选择一种使用。
7+
8+
9+
**注意**:本地的转发端口有可能会退出监听,JSch不能重新建立连接,GANYMED可以重新建立连接,您可视情况用。
10+
11+
12+
### 下载打包
13+
14+
```
15+
git clone https://github.com/nivance/ssh2-spring-boot.git
16+
```
17+
18+
因为没有将ssh-spring-boot放到任何maven公共仓库,所以需要将ssh-spring-boot的jar包安装到本地repository中。
19+
```
20+
cd ssh-spring-boot
21+
22+
mvn clean install
23+
24+
cd ganymed-spring-boot/ganymed-spring-boot-starter/target
25+
26+
mvn install:install-file -Dfile=ganymed-spring-boot-starter-1.0.0.jar \
27+
-DgroupId=ssh2.spring.boot \
28+
-DartifactId=ganymed-spring-boot-starter \
29+
-Dversion=1.0.0 \
30+
-Dpackaging=jar
31+
32+
cd ../../ganymed-spring-boot-autoconfigure/target
33+
34+
mvn install:install-file -Dfile=ganymed-spring-boot-autoconfigure-1.0.0.jar \
35+
-DgroupId=ssh2.spring.boot \
36+
-DartifactId=ganymed-spring-boot-autoconfigure \
37+
-Dversion=1.0.0 \
38+
-Dpackaging=jar
39+
40+
或者:---------------------------------------------------
41+
cd jsch-spring-boot/jsch-spring-boot-starter/target
42+
43+
mvn install:install-file -Dfile=jsch-spring-boot-starter-1.0.0.jar \
44+
-DgroupId=ssh2.spring.boot \
45+
-DartifactId=jsch-spring-boot-starter \
46+
-Dversion=1.0.0 \
47+
-Dpackaging=jar
48+
49+
cd ../../jsch-spring-boot-autoconfigure/target
50+
51+
mvn install:install-file -Dfile=jsch-spring-boot-autoconfigure-1.0.0.jar \
52+
-DgroupId=ssh2.spring.boot \
53+
-DartifactId=jsch-spring-boot-autoconfigure \
54+
-Dversion=1.0.0 \
55+
-Dpackaging=jar
56+
57+
```
58+
59+
### 引用(2选1)
60+
```
61+
<dependency>
62+
<groupId>ssh2.spring.boot</groupId>
63+
<artifactId>jsch-spring-boot-starter</artifactId>
64+
<version>1.0.0</version>
65+
</dependency>
66+
67+
<dependency>
68+
<groupId>ssh2.spring.boot</groupId>
69+
<artifactId>ganymed-spring-boot-starter</artifactId>
70+
<version>1.0.0</version>
71+
</dependency>
6872
```

0 commit comments

Comments
 (0)