`

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://[color=red]IP[/color]: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



推荐几个好的 Maven 常用仓库网址:
http://mvnrepository.com/
http://search.maven.org/
http://repository.sonatype.org/content/groups/public/
http://people.apache.org/repo/m2-snapshot-repository/
http://people.apache.org/repo/m2-incubating-repository/

转载自:http://www.l99.com/EditText_view.action?textId=458901
  • 大小: 75.4 KB
分享到:
评论

相关推荐

    使用Nexus搭建Maven私服

    使用Nexus搭建Maven私服 标题:使用Nexus搭建Maven私服 描述:关于使用Nexus搭建Maven私服的开发文档。 标签:Nexus 搭建Maven 在实际的企业开发中经常会遇到的问题:在进行Maven项目开发时,所需要的构件都是...

    Nexus搭建Maven私服 +maven安装步骤

    Nexus 搭建 Maven 私服 + Maven 安装步骤 Nexus 是一个功能强大且灵活的仓库管理工具,能够帮助开发团队更好地管理项目依赖项和构件。通过搭建 Nexus 私服,可以实现项目依赖项的集中管理、加速项目构建和部署、...

    Windows 下Nexus搭建Maven私服

    ### Windows 下 Nexus 搭建 Maven 私服详解 #### 一、为什么使用 Nexus 在软件开发过程中,尤其是采用 Maven 构建管理的项目中,依赖管理是非常关键的一环。通常,开发人员需要从 Maven 中央仓库下载各种依赖库到...

    基于Nexus搭建Maven私服详解(可用于生产环境)

    提供了基于Nexus搭建Maven私服所需要的一切资源和个人经验,搭建后可maven deploy 上传自己的jar包。别人如何在自己的maven项目中引用我将单独再上传一份。

    在CentOS下使用nexus搭建maven私服的安装教程

    ### 在CentOS下使用Nexus搭建Maven私库的安装教程 #### 一、引言 随着企业级项目规模的不断扩大和技术栈的日益复杂,如何有效地管理项目中的依赖成为了一个重要的问题。Maven作为Java生态中最流行的构建工具之一,...

    Maven Nexus 私服搭建

    Maven Nexus 私服搭建 从零开始,资源下载、安装指导、开发配置说明

    maven使用及Nexus搭建Maven私服.pdf

    ### Maven使用及Nexus搭建Maven私服的知识点详解 #### Maven简介与作用 Maven是Apache软件基金会组织下的一个开源项目,它是一个项目管理和综合工具,主要用于Java项目的构建、依赖管理和项目信息管理。通过Maven...

    nexus 搭建maven私服详解

    使用nexus 可以搭建maven私服,如何使用nexus搭建maven 本地服务器呢?

    Linux下利用nexus搭建maven私服

    【Linux下利用nexus搭建maven私服】 在Linux环境下,Nexus是一款强大的仓库管理器,可以用来搭建Maven私有仓库。Nexus不仅可以作为一个中央仓库的代理,还支持创建自己的存储库,方便组织内部共享依赖,提高开发...

    在CentOS7上用Nexus3搭建Maven私服.doc

    在本文中,我们将详细介绍如何在CentOS7操作系统上使用Nexus3搭建Maven私有仓库。首先,确保系统已经安装了Java Development Kit (JDK) 8和Maven3。安装这两个组件的具体步骤可以通过搜索引擎获取。 一、所需环境 ...

    使用Nexus1.8搭建Maven私服以及在网页上上传JAR包

    使用Nexus1.8搭建MAVEN私服详细步骤,以及在网页上上传JAR包

    Nexus搭建Maven私服指导手册

    ### Nexus搭建Maven私服指导手册 #### 一、Nexus使用背景 在现代软件开发过程中,Maven作为构建工具在Java项目中占据了重要的地位。Maven通过定义项目的对象模型(POM),仅需一个简单的命令就能实现构建和依赖...

    Nexus搭建Maven私服-+maven安装步骤

    我们所需的所有构件都需要通过maven的中央仓库和第三方的Maven仓库下载到本地,而一个团队中的所有人都重复的从maven仓库下载构件无疑加大了仓库的负载和浪费了外网带宽,如果网速慢的话

    nexus搭建maven私服1

    以下是使用 Nexus 搭建 Maven 私服的详细步骤和相关知识点。 1. **下载与安装 Nexus** - 首先,你需要从官方网站(https://www.sonatype.com/download-oss-sonatype)下载 Nexus 的最新版本。 - 解压缩下载的文件...

    使用Nexus搭建Maven私服.docx

    《使用Nexus搭建Maven私服》 Nexus是一款强大的Maven仓库管理器,它旨在简化对本地内部仓库的管理和对外部仓库的访问。Nexus提供了三种主要的仓库类型:Hosted、Proxy和Group,以满足不同需求。 1. Hosted仓库:这...

    Nexus 搭建Maven 私服 .docx

    #### 一、为什么使用Nexus搭建Maven私服 在软件开发过程中,Maven作为一款流行的构建工具,能够有效地管理项目的依赖关系。通常情况下,Maven项目所需的构件(例如JAR包等)会从中央仓库或第三方仓库下载。然而,在...

    linux下搭建内网maven私服

    为了搭建内网 Maven 私服,需要下载和安装 Nexus 仓库管理工具,Nexus 是一个功能强大且灵活的仓库管理工具,支持 Maven、Gradle 和 Ivy 等构建工具。下面是搭建内网 Maven 私服的步骤: 1. 下载 Nexus 首先,需要...

Global site tag (gtag.js) - Google Analytics