同步操作将从 冷川/Linux-Tutorial 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
此时(20160207) Nexus 最新版本为:2.12.0-01
JDK 要求是 JDK 7,官网要求 7u6 或之后版本,包括 JDK 8
官网帮助说明 1:http://books.sonatype.com/nexus-book/2.11/reference/install.html
官网帮助说明 2:http://books.sonatype.com/sonatype-clm-book/html/clm-book/installation-configuration.html
我个人习惯 /opt
目录下创建一个目录 setups
用来存放各种软件安装包;在 /usr
目录下创建一个 program
用来存放各种解压后的软件包,下面的讲解也都是基于此习惯
我个人已经使用了第三方源:EPEL、RepoForge
,如果你出现 yum install XXXXX
安装不成功的话,很有可能就是你没有相关源,请查看我对源设置的文章
压缩包下载(由于国内网络的原因不排除你下载不了):wget http://download.sonatype.com/nexus/oss/nexus-2.12.0-01-bundle.tar.gz
如果地址下载不了,那是因为你需要开 VPN,你也可以选择降低要求下载 2.11.4-01 版本:http://pan.baidu.com/s/1mgSNJtA
tar zxvf nexus-2.11.4-01-bundle.tar.gz
nexus-2.11.4-01
sonatype-work
mv nexus-2.11.4-01/ /usr/program/
cd /usr/program/
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/
vim /usr/program/nexus2.11.4/conf/nexus.properties
nexus-work=${bundleBasedir}/../sonatype-work/nexus
nexus-work=/opt/sonatype-work/nexus
vim /usr/program/nexus2.11.4/bin/jsw/conf/wrapper.conf
sudo iptables -I INPUT -p tcp -m tcp --dport 8081 -j ACCEPT
sudo /etc/rc.d/init.d/iptables save
sudo service iptables restart
测试安装结果:
/usr/program/nexus2.11.4/bin/nexus start
tail -200f /usr/program/nexus2.11.4/logs/wrapper.log
/usr/program/nexus2.11.4/bin/nexus stop
vim /usr/program/nexus2.11.4/conf/nexus.properties
,修改该值:application-port=8081False
改为 True
<repositories>
<repository>
<id>Nexus</id>
<name>虚拟机-192.168.0.110-Nexus</name>
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
</repository>
</repositories>
<mirrors>
<mirror>
<id>YouMeekNexus</id>
<name>YouMeek Nexus</name>
<mirrorOf>*</mirrorOf>
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<!--设置私库认证信息,用户名和密码我就用默认的,如果你们有权限控制的需求可以创建对应的一些账号-->
<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-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>
/usr/program/nexus2.11.4/bin/nexus stop
cd /opt/sonatype-work/nexus/indexer/central-ctx
rm -rf *
wget http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.gz
wget http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.properties
wget https://repo1.maven.org/maven2/org/apache/maven/indexer/indexer-cli/5.1.1/indexer-cli-5.1.1.jar
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。