publish

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:

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

Attribute

Description

Required

organisation

the name of the organisation of the module to publish

No. Defaults to ${ivy.organisation} or the last resolved module organisation.

module

the name of the module to publish

No. Defaults to ${ivy.module} or the last resolved module name.

revision

the revision of the module to publish and also the published revision unless pubrevision is set

No. Defaults to ${ivy.revision} or the last resolve module revision.

artifactspattern

the pattern to use to find artifacts to publish

No. Defaults to ${ivy.publish.src.artifacts.pattern}

resolver

the name of the resolver to use for publication

Yes

pubrevision

the revision to use for the publication

No. Defaults to the ${ivy.deliver.revision}

pubbranch

the branch to use for the publication

No. Defaults to the ${ivy.deliver.branch}

forcedeliver

true 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

update

true 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

merge

if 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

validate

true to force ivy files validation against ivy.xsd, false to force no validation