---
title: "ivy教程(9)-架设仓库(1)-介绍"
author: "skydream"
date: "2009-10-04T13:42:00Z"
tags: []
categories: ["编程语言"]
slug: "ivy-9-1"
draft: false
lastmod: "2009-10-09T21:56:22Z"
id: 483875
url: "https://skydream.iteye.com/blog/483875"
---

install任务让你从一个仓库复制一个模块或者模块集合到另一个仓库。这对于构建和维护一个企业或者团队仓库非常有用。如果你不想你的团队中的开发人员都访问公共的maven2仓库(例如为了控制哪些模块可以在你的公司或者你的团队中使用)，答复开发人员的请求来手工增加新的模块或者新的版本在某些时候变得令人厌烦。

    幸运的是install任务可以在这里提供帮助: 你可以为你的用于维护目标企业仓库的仓库维护构建使用特定的设置。这些设置将指向另一个仓库(例如maven2 公共仓库)，因此你只需要使用简单的命令行要求ivy安装你需要的模块。

    为了演示这个我们将首先使用个一些基本的ivy设置文件来展示它是如何工作的，然后我们将使用高级命名空间特性来演示如何在源仓库和目标仓库之间处理命名不匹配。

    1) 使用的项目

    我们将要使用的项目非常简单。  
    它由一个ant 构建文件和一些ivy设置文件组成。  
   
    这里有一些我们将要使用的target：

Z:\\ivy-repository&gt;ant -p  
Buildfile: build.xml

Main targets:

 clean-cache            --&gt; clean the cache  
 clean-repo             --&gt; clean the destination repository  
 maven2                 --&gt; install module from maven 2 repository  
 maven2-deps            --&gt; install module from maven 2 repository with dependencies  
 maven2-namespace       --&gt; install module from maven 2 using namespaces  
 maven2-namespace-deps  --&gt; install module with dependencies from maven2 repo using namespaces  
Default target: basic

    这个项目在src/example/build-a-ivy-repository下。

下一步:  
[基础仓库复制](/admin/blogs/483874)

[使用命名空间](/admin/blogs/483873)