////
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     https://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
////

The link:../use/install{outfilesuffix}[install] Ant task lets you copy a module or a set of modules from one repository to another. This is very useful to build and maintain an enterprise or team repository. If you don't want to give access to the public Maven 2 repository to the developers on your team (to keep control over which modules are in use in your company or your team, for instance), it can sometimes become tiresome to answer the developers request to add new modules or new versions by hand.

Fortunately the link:../use/install{outfilesuffix}[install] task is here to help: you can use specific settings for your repository maintenance build which will be used to maintain your target enterprise repository. These settings will point to another repository (for instance, the Maven 2 public repository) so that you will just have to ask Ivy to install the modules you want with a simple command line.

To demonstrate this, we will first use a basic Ivy settings file to show how it works, and then we will use the advanced link:../settings/namespaces{outfilesuffix}[namespaces] features to demonstrate how to deal with naming mismatches between the source and target repository.


== The project used

The project that we will use is pretty simple. It is composed of an Ant build file, and two Ivy settings files.

Here are the public targets that we will use:

[source,shell]
----

Z:\ivy-repository>ant -p
Buildfile: build.xml

Main targets:

 clean-cache            --> clean the cache
 clean-repo             --> clean the destination repository
 maven2                 --> install module from Maven 2 repository
 maven2-deps            --> install module from Maven 2 repository with dependencies
 maven2-namespace       --> install module from Maven 2 using namespaces
 maven2-namespace-deps  --> install module with dependencies from Maven 2 repository using namespaces
Default target: basic

----





This project is accessible in the link:https://gitbox.apache.org/repos/asf?p=ant-ivy.git;a=tree;f=src/example/build-a-ivy-repository[src/example/build-a-ivy-repository]

Next steps: +
link:../tutorial/build-repository/basic.html[Basic repository copy] +
link:../tutorial/build-repository/advanced.html[Using namespaces]
