blob: 78d5409c2cd4075c4d33ea9840312a1fa08bdd2f [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.
////
*Tag:* exclude *Parent:* link:../ivyfile/dependency{outfilesuffix}[dependency]
This feature gives you more control on a dependency for which you do not control its Ivy file.
It enables to restrict the artifacts required, by excluding artifacts being published by the dependency or any of its transitive dependencies, even if configuration does not provide a good separation of published artifacts.
The same principle concerning configuration as for include applies to this exclude feature (see the link:../ivyfile/dependency-include.html[include] feature).
Note that exclusion is always done AFTER inclusion has been done.
(*__since 1.3__*) This exclude feature can also be used not only to exclude artifacts but also to exclude whole modules. Indeed when you exclude artifacts, it doesn't prevent Ivy from searching for the module itself, and resolving the dependencies of the module. But you can also exclude the entire module, which means that the module will not be downloaded at all, and so its own dependencies will not be resolved. For sure, this is usually done to exclude not a direct dependency but an indirect one. To exclude a whole module, you just have to not specify any artifact name, type and ext in your exclude rule. For instance:
[source,xml]
----
<dependency name="A" rev="1.0">
<exclude module="B"/>
</dependency>
----
(*__since 2.0__*) A link:../ivyfile/exclude{outfilesuffix}[module wide exclude] can also be used to exclude dependencies for the whole module (and not only in the context of one dependency as it is the case here).
== Attributes
[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|org|the organisation of the dependency module or artifact to exclude, or a regexp matching this organisation (*__since 1.3__*)|No, defaults to `$$*$$`
|module|the name of the dependency module or the artifact to exclude, or a regexp matching this module name (*__since 1.3__*)|No, defaults to `$$*$$`
|name|the name of an artifact of the dependency module to add to the exclude list, or an expression matching this name (see `matcher` attribute below)|No, defaults to `$$*$$`
|type|the type of the artifact of the dependency module to add to the exclude list, or a regexp matching this name|No, defaults to `$$*$$`
|ext|the extension of the artifact of the dependency module to add to the exclude list, or an expression matching this name (see `matcher` attribute below)|No, defaults to the value of `type`
|matcher|the link:../concept{outfilesuffix}#matcher[matcher] to use to match the modules to excludes (*__since 1.3__*)|No, defaults to `exactOrRegexp` in pre 1.3 Ivy files, and `exact` in 1.3 and superior
|conf|comma separated list of the master configurations in which this artifact should be excluded.
`$$*$$` wildcard can be used to designate all configurations of this module|No, defaults to `$$*$$`, unless nested conf are specified
|=======
== Child elements
[options="header",cols="20%,60%,20%"]
|=======
|Element|Description|Cardinality
|link:../ivyfile/artifact-exclude-conf.html[conf]|configuration in which the artifact should be excluded|0..n
|=======