- Documentation (2.6.0-local-20230820130639)
- Release Notes
- Tutorials
- Reference
- Introduction
- System Properties
- Settings Files
- Ivy Files
- Ant Tasks
- artifactproperty
- artifactreport
- buildlist
- buildnumber
- buildobr
- cachefileset
- cachepath
- checkdepsupdate
- cleancache
- configure
- convertmanifest
- convertpom
- deliver
- dependencytree
- findrevision
- fixdeps
- info
- install
- listmodules
- makepom
- post resolve tasks
- publish
- report
- repreport
- resolve
- resources
- retrieve
- settings
- var
- Using standalone
- OSGi
- Developer doc
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 delivers 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:
![ivy publish fc](../images/ivy-publish-fc.png)
(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).
Attributes
Attribute | Description | Required |
---|---|---|
organisation |
the name of the organisation of the module to publish |
No. Defaults to |
module |
the name of the module to publish |
No. Defaults to |
revision |
the revision of the module to publish and also the published revision unless pubrevision is set |
No. Defaults to |
artifactspattern |
the pattern to use to find artifacts to publish |
No. Defaults to |
resolver |
the name of the resolver to use for publication |
Yes |
pubrevision |
the revision to use for the publication |
No. Defaults to the |
pubbranch |
the branch to use for the publication |
No. Defaults to the |
forcedeliver |
|
No. Defaults to |
update |
|
No. Defaults to |
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 false |
validate |
|
No. Defaults to default Ivy value (as configured in settings file) |
replacedynamicrev |
|
No. Defaults to |
publishivy |
|
No. Defaults to |
conf |
A comma separated list of configurations to publish (since 1.4.1). Accepts wildcards (since 2.2). |
No. Defaults to all configurations |
overwrite |
|
No. Defaults to |
warnonmissing |
|
No. Defaults to |
haltonmissing |
|
No. Defaults to |
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 |
pubdate |
the publication date to use for the delivery, if necessary. This date should be either |
No. Defaults to |
status |
the status to use for the delivery, if necessary |
No. Defaults to |
delivertarget |
the target to call for recursive delivery |
No. No recursive delivery is done by default |
settingsRef |
A reference to Ivy settings that must be used by this task (since 2.0) |
No, default to |
Child elements
Element | Description | Cardinality |
---|---|---|
artifact |
Describe additional artifacts to publish. These elements can have any attributes: 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 |
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
.