`
jetway
  • 浏览: 474138 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

Nexus

 
阅读更多

Nexus搭建Maven私服(一) Maven安装

<!-- 源内容容层 --><!-- 如果重飞的源被屏蔽 提示一下 --><!-- 源内容描述 -->

Maven安装

 

下载地址:http://maven.apache.org/download.html

下载(此版本为3.0.4):wget http://mirror.bjtu.edu.cn/apache/maven/binaries/apache-maven-3.0.4-bin.tar.gz

解压安装:tar -xvzf apache-maven-3.0.4-bin.tar.gz

maven的环境配置: vim /etc/profile 中 添加

export M2_HOME=../apache-maven-3.0.4

export PATH=$PATH:$M2_HOME/bin

使环境生效 source /etc/profile

测试maven 安装成功 mvn -v

 

Nexus 网站 http://www.sonatype.org/nexus/

 

下载 http://nexus.sonatype.org/downloads/

 

Nexus提供了两种安装方式,一种是内嵌Jetty的bundle,只要你有JRE就能直接运行。第二种方式是WAR,你只须简单的将其发布到web容器中即可使用.

 

 

解压 tar xvzf nexus-2.0-bundle.tar.gz

 

进入 cd ...bin/jsw/linux-x86-64/中 运行 ./nexus start 即可。

 

http://localhost:8081/nexus 进入. 默认用户名密码为admin/admin123.

立方图片分享

 

nexus默认是关闭远程索引下载功能的,主要是担心会造成对服务器的巨大负担,需要我们手工开启。

开启的方式:
点击Administration菜单下面的Repositories,将这三个仓库Apache Snapshots,Codehaus Snapshots,Maven Central的Download Remote Indexes修改为true。然后在这三个仓库上分别右键,选择Re-index,这样Nexus就会去下载远程的索引文件。

 

要让maven使用nexus作为私服,需要做一些设置,使用和原来设置artifactory相似的方法。修改~/.m2/settings.xml.

增加nexus的profile:

 

<profiles>

<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>Nexus</name>
<url>http://ip:8081/nexus/content/groups/public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Nexus</name>
<url>http://ip:8081/nexus/content/groups/public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled> </snapshots>
</pluginRepository>
</pluginRepositories>

</profile>

</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>

 

镜像:

 

如果你的地理位置附近有一个速度更快的central镜像,或者你想覆盖central仓库配置,或者你想为所有POM使用唯一的一个远程仓库(这个远程仓库代理的所有必要的其它仓库),你可以使用settings.xml中的mirror配置。

<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>Nexus</name>
<url>http://IP:8081/nexus/content/groups/public/</url>
</mirror>

 

<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<name>Nexus</name>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Nexus</name>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled> </snapshots>
</pluginRepository>
</pluginRepositories>

</profile>

 

此配置用Maven私服覆盖central仓库配置 这样Maven对任何仓库的构件下载请求都会转到私服中.

 

需要开机启动maven私服服务

在 /etc/rc.d/rc.local 中加入 nexus/bin/jsw/linux-x86-64/nexus start

分享到:
评论

相关推荐

    Nexus使用Api进行操作

    Nexus提供了RestApi,但是一部分Api仍然需要结合Groovy等进行操作,在3.3及其以后的版本上进行了强化,但是和普通的RestApi相比仍有一些“使用上的特性”。这篇文章以创建raw的repository为例,来确认一下相关的使用...

    nexus-3.23.0-03-win64.rar-Nexus Repository Oss

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个Artifact。Nexus是一套“开箱即用”的系统不...

    nexus-2.14.8-01.zip

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个Artifact。Nexus是一套“开箱即用”的系统不...

    nexus-3.31.1-01-win64.zip

    官网下载 nexus-3.31.1-01-win64 版本;Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个...

    nexus-2.15.0-04-bundle.zip

    Maven 搭建 Nexus 私服 Windows 和 Linux 都可 Nexus 仓库按照类型(Type)区分,主要分为以下 3 个类型: 代理仓库(proxy):用来代理远程公共仓库,如 Maven 中央仓库、JBoss 远程仓库。 宿主仓库(hosted):又...

    官网下载的professional版:nexus-professional-2.15.1-02-bundle

    官网下载的professional版:nexus-professional-2.15.1-02-bundle.zip 专业版 1.Nexus 简介 Nexus是Maven仓库管理器,也可以叫Maven的私服。Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和...

    Nexus Repository Manager 3.28.1-01

    最新版本的 Nexus Repository Manager 3.28.1-01 Nexus是一个强大的Maven仓库管理器,它极大地简化了本地内部仓库的维护和外部仓库的访问。 如果使用了公共的Maven仓库服务器,可以从Maven中央仓库下载所需要的构件...

    nexus-3.5.0-02-unix.tar.gz.zip

    使用:将下载的压缩包解压到当前目录,然后进入文件夹即可看到 nexus-3.18.0-01-mac.tgz nexus-3.18.0-01-win64.zip nexus-3.18.0-01-unix.tar.gz nexus-2.14.5-02.war nexus-2.14.13-01-bundle.zip nexus-2.14.13-...

    nexus-3.61.0-02-unix.tar.gz

    nexus

    官网下载的OSS版:nexus-2.15.1-02-bundle.zip

    官网下载的OSS版:nexus-2.15.1-02-bundle.zip 用于搭建mavne私服 Nexus Repository OSS Nexus 是Maven仓库管理器,如果你使用Maven,你可以从Maven中央仓库 下载所需要的构件(artifact),但这通常不是一个好的做法...

    nexus-3.27.0-03-win64.zip

    最新版的maven私服安装包,nexus-3.27.0-03-win64.zip 。Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护...

    Nexus入门指南(图文).

    Nexus 是Maven仓库管理器,如果你使用Maven,你可以从Maven中央仓库 下载所需要的构件(artifact),但这通常不是一个好的做法,你应该在本地架设一个Maven仓库服务器,在代理远程仓库的同时维护本地仓库,以节省...

    nexus-3.50.0-01-win64.zip

    Nexus Repository Manager是一个强大的仓库管理系统,版本3.50.0-01针对Windows 64位系统。作为现代化的仓库管理解决方案,它为软件开发团队提供了安全、可靠的存储和管理平台。这一版本为软件开发团队提供了一个...

    Maven私服Nexus包下载

    nexus-3.26.1-02-unix.tar.gz 3.26最新版本,nexus-3.26.1-02-unix.tar.gz 3.26最新版本,nexus-3.26.1-02-unix.tar.gz 3.26最新版本,nexus-3.26.1-02-unix.tar.gz 3.26最新版本,nexus-3.26.1-02-unix.tar.gz 3.26...

    nexus-professional-2.14.19-01-bundle.zip

    2020年10月09日,360CERT监测发现 `nexus repository manager 2` 发布了 `nexus repository manager 2 目录穿越漏洞` 的风险通告,该漏洞编号为 `CVE-2020-15012` ,漏洞等级: `高危` ,漏洞评分: `8` 。...

    nexus-3.2.0-01-win64

    为什么要搭建nexus私服,原因很简单,有些公司都不提供外网给项目组人员,因此就不能使用maven访问远程的仓库地址,所以很有必要在局域网里找一台有外网权限的机器,搭建nexus私服,然后开发人员连到这台私服上,...

    maven 私服 nexus2 nexus3 安装与说明

    maven 私服 nexus2 nexus3 安装与说明,只有简单的安装,没有详细的配置使用说明

    nexus-3.5.part2

    Nexus Repository Manager OSS 3.x The latest version of Nexus Repository OSS, providing cutting-edge support for the formats below. Note: More information can be found in the documentation, release ...

    Linux系统部署Nexus操作步骤(nexus-3.20.1-01).zip

    Linux系统部署Nexus操作步骤(nexus-3.20.1-01) Linux系统部署Nexus操作步骤(nexus-3.20.1-01) Linux系统部署Nexus操作步骤(nexus-3.20.1-01)

    Nexus Repository Manager的使用

    Nexus Repository Manager的使用Nexus Repository Manager的使用

Global site tag (gtag.js) - Google Analytics