Skip navigation.

publish

Publishes the current modules artifacts.

This task is meant to publish the declared published artifacts of the current module to a repository.

The repository is given through the name of a resolver declared in current ivy configuration. See configuration 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.

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
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}
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
validate true to force ivy files validation against ivy.xsd, false to force no validation No. Defaults to default ivy value (as configured in configuration file)
replacedynamicrev true to replace dynmic revisions by static ones in the delivered file, false to avoid this replacement since 1.3 No. Defaults to true
publishivy True to publish delivered ivy file, false otherwise No. Defaults to true
conf A comma separated list of configurations to publish. Note that the ivy file won't be published in this case, publishivy must be set to false. since 1.4.1 No. Defaults to all configurations published
overwrite True to overwrite files in repository if the revision already exist, false to let it as is No. Defaults to false
warnonmissing True to warn when artifacts to be published are missing No. Defaults to true
haltonmissing True to halt build when artifacts to be published are missing No. Defaults to true
srcivypattern the pattern to use to find ivy file to publish, and even deliver if necessary (since 1.2) No. Defaults to the value of artifactspattern
pubdate the 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'
status the status to use for the delivery, if necessary No. Defaults to ${ivy.status}
delivertarget the target to call for recursive delivery No. No recursive delivery is done by default

Examples

<ivy:publish resolver="local" pubrevision="1.0">
  <artifacts pattern="1/[artifact].[ext]" />
  <artifacts pattern="2/[artifact].[ext]" />
</ivy:publish>

Publishes the last resolved module in the local resolver with revision 1.0, looking for artifacts in directories 1 and 2.