////
   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:* artifact *Parent:* link:../ivyfile/publications{outfilesuffix}[publications]

Declares an artifact published by this module. This is especially useful for other modules depending on this one. They thus get all published artifacts belonging to the configurations asked. Indeed, each published artifact declares in which public configuration it is published. Thus a module depending on this module only get artifacts marked with the asked configurations, taking into account configurations extension (see link:../ivyfile/conf{outfilesuffix}[configuration declaration]).

The configurations in which an artifact is published can be configured in two ways:

* `conf` attribute on an `artifact` element
* `conf` subelement

The two are equivalent, it is only a matter of preference. However, do not mix both for one artifact.

[*__since 1.4__*]

The artifact element has default values for all its attributes, so if you want to declare a default artifact you can just declare it like that:

[source,xml]
----
<artifact/>
----

If this is the only artifact declared, then it's equivalent to having no publication section at all.

It is possible to give an `url` at which artifacts can be found. This is not mandatory, and even not recommended. This is only a convenient way to deal with an existing repository with a bad layout, but should not be avoided in an enterprise repository.

This tag supports link:../concept{outfilesuffix}#extra[extra attributes].

(*__since 2.4__*) This tag supports the 'packaging' attributes; complete documentation can be found in the link:../concept{outfilesuffix}#packaging[concept page].

== Attributes

[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|name|the name of the published artifact. This name must not include revision.|No, defaults to the name of the module
|type|the type of the published artifact. It's usually its extension, but not necessarily. For instance, Ivy files are of type `ivy` but have `xml` extension|No, defaults to `jar`
|ext|the extension of the published artifact|No, defaults to the value of `type`
|conf|comma separated list of public configurations in which this artifact is published.

`$$*$$` wildcard can be used to designate all public configurations of this module|No, defaults to `defaultconf` attribute value on parent publications element.
|url|an URL at which this artifact can be found if it isn't located at the standard location in the repository (*__since 1.4__*)|No, defaults to no URL
|packaging|a comma separated list of link:../concept{outfilesuffix}#packaging[packaging] types (*__since 2.4__*)|No, defaults to no packaging
|=======

== Child elements

[options="header",cols="20%,60%,20%"]
|=======
|Element|Description|Cardinality
|link:../ivyfile/artifact-conf{outfilesuffix}[conf]|indicates a public configuration in which this artifact is published|0..n
|=======

== Examples

[source,xml]
----
<artifact/>
----

Declares an artifact with the name of the module as name, type and ext jar, and published in all configurations.

'''

[source,xml]
----
<artifact name="foo-src" type="source" ext="zip" conf="src"/>
----

Declares an artifact `foo-src`, of type `source` with extension `zip`, and published in the `src` configuration.

'''

[source,xml]
----
<artifact name="foo" url="http://www.acme.com/repository/barbaz/foo-1.2-bar.jar"/>
----

Declares an artifact `foo`, of type and extension `jar'` located at the URL `$$http://www.acme.com/repository/barbaz/foo-1.2-bar.jar$$`. This URL will only be used if the artifact cannot be found at its standard location.
