publish


Publishes the current module's artifacts and the resolved descriptor (delivered ivy file).

This task is meant to publish the current module descriptor together with its declared publication artifacts to a repository.

All the artifacts must have been created before calling this task. It does not create the artifacts themselves, but expects to find them at the location indicated by the artifacts pattern.

The target repository is given through the name of a resolver declared in current ivy settings. See Settings Files for details about resolver supporting artifact publishing.

It also publishes the delivered ivy file (except if you don't want), and even deliver it, if it has not been done with a previous deliver call or if forcedeliver is set to true. That's why this task takes some parameters useful only for delivery. See the illustration below:

publish flowchart

since 1.4.1 The source artifact pattern can be specified either as an attribute on the task (artifactspattern) or using a list of nested artifacts element (see examples below).
AttributeDescriptionRequired
organisationthe name of the organisation of the module to publishNo. Defaults to ${ivy.organisation} or the last resolved module organisation.
modulethe name of the module to publishNo. Defaults to ${ivy.module} or the last resolved module name.
revisionthe revision of the module to publish and also the published revision unless pubrevision is setNo. Defaults to ${ivy.revision} or the last resolve module revision.
artifactspatternthe pattern to use to find artifacts to publish No. Defaults to ${ivy.publish.src.artifacts.pattern}
resolverthe name of the resolver to use for publication Yes
pubrevisionthe revision to use for the publication No. Defaults to the ${ivy.deliver.revision}
pubbranchthe branch to use for the publication No. Defaults to the ${ivy.deliver.branch}
forcedelivertrue to force the implicit call to deliver, false to do it only if the ivy file to publish doesn't exist yet (since 1.4) No. Defaults to false
updatetrue to update ivy file metadata (revision, branch, publication date and status) before publishing, false otherwise. This is usually not necessary when using deliver before publish. No. Defaults to false
mergeif this descriptor extends a parent, merge the inherited information directly into this descriptor on publish. The extends element itself will be commented out in the published descriptor. (since 2.2) No. Defaults to true
validatetrue to force ivy files validation against ivy.xsd, false to force no validation No. Defaults to default ivy value (as configured in settings file)
replacedynamicrevtrue to replace dynamic revisions by static ones in the delivered file, false to avoid this replacement (since 1.3) No. Defaults to true
publishivyTrue to publish delivered ivy file, false otherwise No. Defaults to true
confA comma separated list of configurations to publish (since 1.4.1). Accepts wildcards (since 2.2). No. Defaults to all configurations
overwriteTrue to overwrite files in repository if the revision already exist, false to let it as is No. Defaults to false
warnonmissingTrue to warn when artifacts to be published are missing No. Defaults to true
haltonmissingTrue to halt build when artifacts to be published are missing No. Defaults to true
srcivypatternthe pattern to use to find ivy file to publish, and even deliver if necessary (since 1.2) No. Defaults to the value of artifactspattern
pubdatethe publication date to use for the delivery, if necessary. This date should be either 'now', or a date given with the following pattern: yyyyMMddHHmmss No. Defaults to 'now'
statusthe status to use for the delivery, if necessary No. Defaults to ${ivy.status}
delivertargetthe target to call for recursive delivery No. No recursive delivery is done by default
settingsRefA reference to the ivy settings that must be used by this task (since 2.0)No, 'ivy.instance' is taken by default.

Child elements

ElementDescriptionCardinality
artifact Describe additional artifacts to publish
These elements can have any attribute: standard artifact attributes and (since 2.2) extra attributes are supported.
0..n
artifacts Specify the pattern used to find the artifact.
These elements have a pattern attribute containing the pattern used to find the artifact.
0..n

Examples

<ivy:publish resolver="local" pubrevision="1.0">
<artifacts pattern="build/artifacts/jars/[artifact].[ext]" />
<artifacts pattern="build/artifacts/zips/[artifact].[ext]" />
</ivy:publish>
Publishes the last resolved module in the local resolver with revision 1.0, looking for artifacts in directories build/artifacts/jars and build/artifacts/zips.