1、 先搭建好基本配置环境:
1、 服务器环境CentOS6.5
![386be5caf74915aa57d2fd876f0e590f.png](https://img-blog.csdnimg.cn/img_convert/386be5caf74915aa57d2fd876f0e590f.png)
2、 配置网络、关闭Selinux和防火墙
![d52ab33228d856019d1d2ae62558c6dc.png](https://img-blog.csdnimg.cn/img_convert/d52ab33228d856019d1d2ae62558c6dc.png)
3、已配置YUM源,虚拟机准备一些工具
(1)yum install -y lrzsz
(2)yum install -y gcc
(3)yum install -y gcc-c++
(4)yum install -y vim
(5)yum install -y openssh-clients
(6)yum install -y createrepo
(7)yum install -y wget
(8)yum install -y httpd
(9)yum install -y ntp
2、 搭建服务器环境:
以下均在root用户权限下操作
我们准备一个目录用来存放我们的离线工具包
![16f6490522e80132bf6c2d07a6f9998e.png](https://img-blog.csdnimg.cn/img_convert/16f6490522e80132bf6c2d07a6f9998e.png)
1、首先我们安装jdk
上传工具包
![cec956616b4660e3721648e1f3a05fde.png](https://img-blog.csdnimg.cn/img_convert/cec956616b4660e3721648e1f3a05fde.png)
编写脚本
命令tee
(1)读取标准输入的数据,并将其内容输出成文件
(2)主要用于重定向到文件
常用参数
-a,将读取的内容追加到文件的后面,而不是覆盖(在默认的情况下是覆盖)
命令tee与重定向的区别
重定向,是将读取的内容输出到指定文件中,在屏幕上并不显示
命令tee,在屏幕上显示的同时,将读取的内容也重定向到指定文件中
脚本
![f966a54d886c66400d790e17188f616b.png](https://img-blog.csdnimg.cn/img_convert/f966a54d886c66400d790e17188f616b.png)
2、安装Maven
上传工具包
![0da4eeec414db1e5f62656432fae5abf.png](https://img-blog.csdnimg.cn/img_convert/0da4eeec414db1e5f62656432fae5abf.png)
编写脚本
![901d11780cc2730401f0db5e14008b70.png](https://img-blog.csdnimg.cn/img_convert/901d11780cc2730401f0db5e14008b70.png)
其中我将已经准备好的仓库放到指定的位置,防止项目重新下载太多jar包
仓库地址
![60c974996aaefbed613e311e310eaf1a.png](https://img-blog.csdnimg.cn/img_convert/60c974996aaefbed613e311e310eaf1a.png)
配置文件settings.xml中的关键部分
本地仓库
![948b741ae9e9545c598e7badf3ef1ae7.png](https://img-blog.csdnimg.cn/img_convert/948b741ae9e9545c598e7badf3ef1ae7.png)
镜像地址
![dc7faf3b6a1b4e72955032a2f4430389.png](https://img-blog.csdnimg.cn/img_convert/dc7faf3b6a1b4e72955032a2f4430389.png)
3、安装Resin
上传工具包
![b5846164dfde51f9b0a495dfab96994b.png](https://img-blog.csdnimg.cn/img_convert/b5846164dfde51f9b0a495dfab96994b.png)
编写脚本
![303db5d217fb606486c6eff528bcfea8.png](https://img-blog.csdnimg.cn/img_convert/303db5d217fb606486c6eff528bcfea8.png)
配置中的关键部分resin.xml,是为了方便配置项目
![36e4bddb9e96ebae17e2f07c9f9458b3.png](https://img-blog.csdnimg.cn/img_convert/36e4bddb9e96ebae17e2f07c9f9458b3.png)
启动后访问到resin就可以了
![2f2a49bd40ce40cee21e92c55b757751.png](https://img-blog.csdnimg.cn/img_convert/2f2a49bd40ce40cee21e92c55b757751.png)