Skip to content

Commit

Permalink
2016-03-17进入初稿整理阶段
Browse files Browse the repository at this point in the history
  • Loading branch information
judasn committed Mar 17, 2016
1 parent 0f86a72 commit 25d21da
Show file tree
Hide file tree
Showing 13 changed files with 563 additions and 143 deletions.
2 changes: 1 addition & 1 deletion CentOS-Other-Bash.md → Bash-Other-Bash.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1id="bash0">CentOS 其他常用命令</h1>
<h1id="bash0">Bash 其他常用命令</h1>

------

Expand Down
12 changes: 8 additions & 4 deletions Bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@
- `rm -r -i 文件夹`,在删除文件夹里的文件会提示(要的话,在提示后面输入yes)
- `rm -r -f 文件夹`,强制删除
- `rm -r -f 文件夹1/ 文件夹2/ 文件夹3/`删除多个
- `find`高级查找
- `find. -name *lin*`,其中.代表在当前目录找,-name表示匹配文件名/文件夹名,*lin*用通配符搜索含有lin的文件或是文件夹
- `find/ -name *.conf`,其中/代表根目录查找,*.conf代表搜索后缀会.conf的文件
- `find. -name "lin*" -execls -l{}\;`,当前目录搜索lin开头的文件,然后用其搜索后的结果集,再执行ls -l的命令(这个命令可变,其他命令也可以),其中-exec和{}\;都是固定格式
- `find` 高级查找
- `find . -name *lin*`,其中 . 代表在当前目录找,-name 表示匹配文件名 / 文件夹名,\*lin\* 用通配符搜索含有lin的文件或是文件夹
- `find . -iname *lin*`,其中 . 代表在当前目录找,-iname 表示匹配文件名 / 文件夹名(忽略大小写差异),\*lin\* 用通配符搜索含有lin的文件或是文件夹
- `find / -name *.conf`,其中 / 代表根目录查找,*.conf代表搜索后缀会.conf的文件
- `find /opt -name .oh-my-zsh`,其中 /opt 代表目录名,.oh-my-zsh 代表搜索的是隐藏文件 / 文件夹名字为 oh-my-zsh 的
- `find /opt -type f -iname .oh-my-zsh`,其中 /opt 代表目录名,-type f 代表只找文件,.oh-my-zsh 代表搜索的是隐藏文件名字为 oh-my-zsh 的
- `find /opt -type d -iname .oh-my-zsh`,其中 /opt 代表目录名,-type d 代表只找目录,.oh-my-zsh 代表搜索的是隐藏文件夹名字为 oh-my-zsh 的
- `find . -name "lin*" -execls -l{}\;`,当前目录搜索lin开头的文件,然后用其搜索后的结果集,再执行ls -l的命令(这个命令可变,其他命令也可以),其中 -exec 和 {}\; 都是固定格式

<h2 id="information">资料</h2>

Expand Down
78 changes: 0 additions & 78 deletions CI-Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,84 +9,6 @@

------

<h2 id="nexus1">Nexus 安装</h2>

- maven 的 全局配置:
```
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--本地仓库路径-->
<localRepository>D:/maven/my_local_repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<!--配置 nexus 仓库用户名密码 -->
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<!--配置 nexus 仓库用户名密码 -->
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<!-- 配置 tomcat 的用户名和密码 -->
<server>
<id>tomcatRole</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>
<mirrors>
<mirror>
<id>privateNexusMirror</id>
<name>YouMeek Nexus</name>
<mirrorOf>*</mirrorOf>
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>privateNexusProfile</id>
<repositories>
<repository>
<id>privateRepo</id>
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>privateNexusProfile</activeProfile>
</activeProfiles>
</settings>
```


<h2 id="nexus3">资料</h2>

Expand Down
127 changes: 116 additions & 11 deletions Maven-Install-And-Settings.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
<h1 id="maven0">Maven 安装和配置</h1>
# Maven 安装和配置

------

* [Maven 安装和配置](#maven0)
* [Maven 安装](#maven1)
* [Maven 配置](#maven2)
* [资料](#maven3)

------

<h2 id="maven1">Maven 安装</h2>
## Maven 安装

- Maven 安装
- 官网:<http://maven.apache.org/>
Expand All @@ -25,6 +18,7 @@
- 移到我个人习惯的安装目录下:`mv maven3.3.9/ /usr/program`
- 环境变量设置:`vim /etc/profile`
- 在文件最尾巴添加下面内容:

```
# Maven
MAVEN_HOME=/usr/program/maven3.3.9
Expand All @@ -34,17 +28,128 @@
export PATH
export MAVEN_OPTS
```
- 刷新配置文件:`source /etc/profile`
- 测试是否安装成功:`mvn -version`
<h2 id="maven2">Maven 配置</h2>
## Maven 配置
- 配置项目连接上私服
- 全局方式配置:
``` bash
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!--本地仓库位置-->
<localRepository>D:/maven/my_local_repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<!--设置 Nexus 认证信息-->
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!--设置 Nexus 镜像,后面只要本地没对应的以来,则到 Nexus 去找-->
<mirrors>
<mirror>
<id>nexus-releases</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>nexus-snapshots</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus-releases</id>
<url>http://nexus-releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>nexus-snapshots</id>
<url>http://nexus-snapshots</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-releases</id>
<url>http://nexus-releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>nexus-snapshots</id>
<url>http://nexus-snapshots</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
```

- 项目级别:




<h2 id="maven3">资料</h2>
## 资料

- <http://maven.apache.org/install.html>
- <http://www.tutorialspoint.com/maven/index.htm>
- <http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html>
- <http://maven.apache.org/guides/getting-started/index.html>
- <http://maven.apache.org/general.html>
- <http://stackoverflow.com/questions/6950346/infrastructure-with-maven-jenkins-nexus>
- <http://blog.csdn.net/sxyx2008/article/details/7975129>
- <http://blog.csdn.net/xuke6677/article/details/8482472>
76 changes: 55 additions & 21 deletions Nexus-Install-And-Settings.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<h1 id="nexus">Nexus 安装和配置</h1>
# Nexus 安装和配置

------

* [Nexus 安装和配置](#nexus)
* [Nexus 安装](#install)
* [Nexus 配置](#settings)
* [Nexus 手动更新索引文件](#update-index)
* [资料](#information)

------

<h2 id="install">Nexus 安装</h2>
## Nexus 安装

- Nexus 安装
- 官网:<http://www.sonatype.org/nexus/>
Expand All @@ -32,13 +24,15 @@
- 把目录名字改为更好看点:`mv nexus-2.11.4-01/ nexus2.11.4/`
- 编辑系统配置文件:`vim /etc/profile`
- 在文件的尾巴增加下面内容:

```
# Nexus
NEXUS_HOME=/usr/program/nexus2.11.4
export NEXUS_HOME
RUN_AS_USER=root
export RUN_AS_USER
```
- 刷新配置:`source /etc/profile`
- 由于目录 `sonatype-work` 以后是做仓库用的,会存储很多 jar,所以这个目录一定要放在磁盘空间大的区内,目前我们还没第一次启动 Nexus,所以这里还是空文件
- 我个人习惯把这类目录放在 `/opt` 下,所以你要特别注意,下面有内容对这个文件夹进行操作的都是基于 opt 目录的:`mv /opt/setup/sonatype-work/ /opt/`
Expand All @@ -58,18 +52,16 @@
- 登录账号密码:
- 账号密码:**admin**
- 密码:**admin123**
<h2 id="settings">Nexus 配置</h2>
## Nexus 配置
- 修改默认端口:`vim /usr/program/nexus2.11.4/conf/nexus.properties`,修改该值:application-port=8081
- 下载远程中央库的索引到服务器
- ![Nexus 配置](images/Nexus-Install-And-Settings-a-1.jpg)
- 如上图标注 4 所示,把默认是 `False` 改为 `True`
- ![Nexus 配置](images/Nexus-Install-And-Settings-a-2.gif)
- 如上图 gif 所示,创建任务开始进行索引下载。需要特别提醒的是,如果你的私服是虚拟机,那得保证你分配的硬盘足够大,别像我一样吝啬只给 10 G(现在还剩下 1.9 G),结果报:**设备上没有空间**
- 项目上配置链接连接私服(下面内容涉及到 maven 的基础知识,请自行私下学习):
- 对项目独立设置:
- 打开项目的 pom.xml 文件:
Expand All @@ -96,9 +88,50 @@
</mirror>
</mirrors>
```
<h2 id="update-index">Nexus 手动更新索引文件</h2>
## 持续集成自动构建后发布到 Nexus 上
- 在 Maven 的 settings.xml 加上连接服务器信息:
``` bash
<!--设置私库认证信息,用户名和密码我就用默认的,如果你们有权限控制的需求可以创建对应的一些账号-->
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
```


- 在项目的 pom.xml 文件加上:

``` bash
<!-- nexus-releases nexus-snapshots 与 Maven 的配置文件 settings.xml 中 server 下的 id 对应 -->
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Releases Repository</name>
<url>http://192.168.0.110:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshots Repository</name>
<url>http://192.168.0.110:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
```



## Nexus 手动更新索引文件
- 手动更新索引
- 关闭 Nexus:`/usr/program/nexus2.11.4/bin/nexus stop`
- 命令:`cd /opt/sonatype-work/nexus/indexer/central-ctx`
Expand All @@ -110,8 +143,9 @@
- 执行解压命令(该命令执行需要4分钟左右):`java -jar indexer-cli-5.1.0.jar -u nexus-maven-repository-index.gz -d ./`
- 删除解压前文件:`rm -rf indexer-cli-5.1.0.jar nexus-maven-repository-index.gz nexus-maven-repository-index.properties`
- 重启服务:`/usr/program/nexus2.11.4/bin/nexus start`
<h2 id="information">资料</h2>


## 资料

- <http://www.cnblogs.com/leefreeman/p/4211530.html>
- <http://www.itdadao.com/article/89071/>
Expand Down
Loading

0 comments on commit 25d21da

Please sign in to comment.