---
title: "maven学习三部曲之三、基于nexus搭建本地仓库"
author: "wen147258"
date: "2014-08-06T17:21:56Z"
tags: []
categories: ["开源软件"]
slug: "maven-nexus"
draft: false
lastmod: "2014-08-06T17:21:56Z"
id: 2101037
url: "https://wen147258.iteye.com/blog/2101037"
---

基于nexus搭建本地仓库的步骤： 1、下载nexus，启动nexus,在nexus目录\\bin\\jsw\\windows-x86-32目录下启动nexus，或者安装nexus服务。 2、可以在nexus目录下的conf目录下修改nexus.properties修改一些参数，比如启动端口，nexus的工作目录等 3、在maven的setting.xml中的profiles下添加如下配置： \[code="java"] nexus-public nexus http://localhost:9090/nexus/content/groups/public true true \[/code] 4、激活profile，添加如下配置： \[code="java"] nexus-public \[/code] 这样就ok了，当你在pom.xml文件添加依赖时，首先会去nexus中找，如果没有的话再去maven 中心仓库中下载，关于nexus的使用，大家自己可以上网找找资料学习一下。但是这样还会有一个问题，如果有人在完成这个项目之后给大家共享，就还需要以下步骤了： 1、在setting.xml文件中添加： \[code="java"] nexus-releases admin admin123 nexus-snapshots admin admin123 \[/code] 2、在pom.xml中添加： \[code="java"] nexus-releases Nexus Release Repository http://localhost:9090/nexus/content/repositories/releases/ nexus-snapshots Nexus snapshots Repository http://localhost:9090/nexus/content/repositories/snapshots/ \[/code] 这样就ok了，以上就是所有的maven的知识，其实我没有讲好，是因为我是在一天一口气写了这三篇文章，随后我会把这三篇文件优化一下，尤其是第二篇文章，我觉得太不详细了，有点简陋，里面的各个元素代表什么作用也没给大家讲，但是这方面的资料网上已经很多了，但是关于模块化的东西比较少。