blob: 532f636135031d58be1add502ec7435ffbc7ac95 [file] [log] [blame]
////
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.
////
[*__since 1.3__*]
Installs a module and all its dependencies in a resolver.
The module to install should be available in a resolver, and will be installed in another resolver which should support publish.
This is particularly useful for users who only have a private repository, and want to benefit from public repositories from time to time. In this case, when a module is missing in the private repository, a call to install lets download the module from a public repository not usually used for dependency resolution, and install it and its dependencies in the private repository.
For more details about this task and its usage see the link:../tutorial/build-repository.html[build repository tutorial]
== Attributes
[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|from|the name of the resolver in which the module must be found|Yes
|to|the name of the resolver in which the module must be installed|Yes
|organisation|the name of the organisation of the module to install|Yes
|module|the name of the module to install|Yes
|branch|the branch of the module to install (*__since 2.0__*)|No, defaults to default branch with exact matcher, `*` with any other matcher
|revision|the revision of the module to install|Yes
|type|the type(s) of artifact(s) to install. You can give multiple values separated by commas|No, defaults to `*` meaning all types
|conf|the configurations to install. Only the dependencies of the specified configurations will be installed. (*__since 2.3__*)|No, defaults to `*` meaning all configurations
|validate|`true` to force Ivy files validation against ivy.xsd, `false` to force no validation|No. Defaults to default Ivy value (as configured in settings)
|overwrite|`true` to override modules already present in the destination resolver, `false` otherwise|No, defaults to `false`
|transitive|`true` to install the module and all its transitive dependencies, `false` to install only the module|No, defaults to `false`
|matcher|the name of the matcher to use to find the modules to install|No, defaults to `exact`
|settingsRef|A reference to Ivy settings that must be used by this task (*__since 2.0__*)|No, defaults to `ivy.instance`.
|haltonfailure|`true` to fail build on unresolved dependencies (*__since 2.0__*)|No, defaults to `true`
|installOriginalMetadata|`true` to install original metadata (if available). If the module has been originally resolved from a m2 repository, the original metadata is the original POM file (*__since 2.4__*)|No, defaults to `false`
|=======
== Examples
[source,xml]
----
<ivy:install organisation="apache" module="commons-lang" revision="2.0" from="ivyrep" to="myfsresolver"/>
----
Installs the module `commons-lang` from `apache` in revision 2.0 in the resolver `myfsresolver`. The module is found in the resolver named `ivyrep`.