本次安装系统环境 debian/ubuntu
首先去官方网站 http://www.sonatype.org/nexus/可以看到Nexus有两种发放形式,war包
可以直接部署到tomcat下。tgz or zip可以直接执行的版本。我们首先看看tgz版本的安装方法。
wget http://www.sonatype.org/downloads/nexus-latest-bundle.tar.gz
apt-get install default-jre
来进行安装 请确认你安装的jre版本是否大于1.7/usr/local/
目录下再进行解压缩
$ sudo cp nexus-2.8.0-05-bundle.tar.gz /usr/local $ cd /usr/local $ sudo tar xvzf nexus-2.8.0-05-bundle.tar.gz $ ln -s nexus-2.8.0-05 nexus
/usr/local/nexus/bin/nexus console
。当启动成功可以看到如下提示
Running Nexus OSS... wrapper | --> Wrapper Started as Console wrapper | Launching a JVM... jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
no zuo no die。采用这种方式安装的有个天生缺陷,对CPU的支持有限。查看bin/jsw目录会发现 linux-ppc-64 linux-x86-32 linux-x86-64 macosx-universal-32 macosx-universal-64 solaris-sparc-32 solaris-sparc-64 solaris-x86-32 windows-x86-32 windows-x86-64
如果我们的CPU在以上类型以外比如树霉派的ARM类型。那么你将要学习如下安装方法。使用WAR包安装
wget http://download.sonatype.com/nexus/oss/nexus-2.10.0-02.war
{TOMCAT_HOME}/webapps
,在目录 /usr/share/tomcat7
下创建 sonatype-work
目录,并将所有者修改为 tomcat7Repositories
,在列表中选择 Central 。打开Configuration标签,将Download Remote Indexes改为True即可开始自动下载。HTTP Request Settings->Request Timeout
改的大点我基本都是3小时左右超时。<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8080/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
当然Nexus功能或要学习的东西还不止这些。比如怎么在Nexus上部署Nuget,让.Net程序可以来这下载包。怎么上传自己私有的JAR包,如果监控NEXUS状态。我会在今后的BLOG上继续更新。