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

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

= Jar resolver

[]
|=======
|Tag|jar
|Handle latest|yes
|Handle publish|no
|=======

[*__since 2.3__*]

[ivysettings.resolvers.jar]#This resolver uses a specified jar resolve Ivy files and artifacts.#

This kind of resolver helps the packaging of an entire repository. Since the entire "repository" jar is expected to be local at some point, the size of a such repository should be considered to be not too large if it is expected to be remote; hence the artifacts in a such repo should be little in size.

The configuration of such a resolver is done via specifying the location of the jar, and through Ivy and artifact patterns, indicating where Ivy files and artifacts can be found in the jar. You can indicate a list of patterns which will be checked one after the other. Note that the patterns *MUST NOT* start with a slash.


== Attributes

This resolver shares the link:../settings/resolvers{outfilesuffix}#common[common attributes] of standard resolvers.

[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|file|the absolute path of the jar|One of 'file' or 'url' is required
|url|the URL of the jar|One of 'file' or 'url' is required
|=======


== Child elements


[options="header"]
|=======
|Element|Description|Cardinality
|ivy|defines a pattern for Ivy files, using the pattern attribute|0..n
|artifact|defines a pattern for artifacts, using the pattern attribute|1..n
|=======



== Examples


[source, xml]
----

<jar name="my-local-jar-resolver" file="/home/me/myrepo.jar">
    <ivy pattern="[organisation]/[module]/ivys/ivy-[revision].xml"/>
    <artifact pattern="[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
</jar>

----

A simple local jar repository.

'''


[source, xml]
----

<jar name="my-remote-jar-resolver" url="http://www.mywebsite.com/dist/myrepo.jar">
    <ivy pattern="dir_in_jar/subdir_in_jar/[organisation]/[module]/ivys/ivy-[revision].xml"/>
    <ivy pattern="dir_in_jar/another_subdir_in_jar/[organisation]/[module]/ivys/ivy-[revision].xml"/>
    <artifact pattern="dir_in_jar/subdir_in_jar/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
    <artifact pattern="dir_in_jar/another_subdir_in_jar/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
    <artifact pattern="dir_in_jar/yet_another_subdir_in_jar/[organisation]/[module]/[type]s/[artifact]-[revision].[type]"/>
</jar>

----

A remote jar repository with multiple Ivy and artifact patterns, patterns pointing in some sub directories in the jar.
