////
   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.
////

= module

*Tag:* module

[ivysettings.modules.module]#Define a module set rule.# The tag defines a module set, by giving an expression and the matcher to use for organisation, name, revision and any extra attribute identifying your modules. The rule matching is performed in order, and is using a pattern matcher. Hence you can use `*` to specify all, or simply avoid specifying the attribute.

The revision and extra attributes are only used for rules defining the resolver to use. For other settings, use only organisation and module name.

It also gives the specific setting to use for this module set.

For each module set, you can configure:


    * the link:../settings/resolvers{outfilesuffix}[resolver] to use +

    * the link:../settings/conflict-managers{outfilesuffix}[conflict manager] to use +

    * the default link:../terminology{outfilesuffix}#branch[branch] to use +

    * the link:../use/resolve{outfilesuffix}[resolve mode] to use +



== Attributes


[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|organisation|the organisation to match to apply the rule.|No, defaults to *
|name|the module's name to match to apply the rule.|No, defaults to *
|revision|the module's revision to match to apply the rule. Note that the version may not be resolved yet (be `latest.integration`, for instance), so be very careful when using this attribute (*__since 2.0__*).|No, defaults to *
|_any extra attribute_|an extra attribute to match to apply the rule (*__since 2.0__*).|No, defaults to *
|matcher|the link:../concept{outfilesuffix}#matcher[matcher] to use to match the modules to which the resolver should be applied (*__since 1.3__*).|No, defaults to exactOrRegexp
|resolver|the name of the resolver to apply. The resolver must have been defined in the resolvers section of the settings file.|No
|conflict-manager|the name of the conflict manager to apply (*__since 1.4__*).|No
|branch|the default branch to apply (*__since 1.4__*).|No
|resolveMode|the resolve mode to use (*__since 2.0__*).|No
|=======


== Examples


[source, xml]
----

<modules>
  <module organisation="apache" name="*" resolver="myprojectsresolver"/>
</modules>

----

Uses myprojectresolver for all modules from __apache__.

'''


[source, xml]
----

<modules>
  <module organisation="apache" name="commons-*" matcher="glob" resolver="myapachecommonsresolver"/>
</modules>

----

Uses myapachecommonsresolver for all modules beginning with `commons-` from `apache`.

'''


[source, xml]
----

<modules>
  <module organisation="apache" name="commons-[a-z]+" myextra="val.*" matcher="regexp" resolver="myapachecommonsresolver"/>
</modules>

----

Uses `myapachecommonsresolver` for all modules from `apache` beginning with `commons-` followed by any number of alphabetic lowercase characters, and with the extra attribute `myextra` having a value beginning with `val.`.

'''


[source, xml]
----

<modules>
  <module organisation="apache" name="ivy*" matcher="glob" conflict-manager="latest-time"/>
</modules>

----

Uses `latest-time` conflict manager for all modules from `apache` whose name begins with `ivy`.

'''


[source, xml]
----

<modules>
  <module organisation="apache" name="ivy*" matcher="glob" branch="fix-103"/>
</modules>

----

Uses `fix-103` as default branch for all modules from `apache` whose name begins with `ivy`.
