blob: e37e2e8f5ddab0e4c04c22b7b9c068fb25fa26cb [file] [log] [blame]
////
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.
////
[*__since 1.1__*]
Sets an Ant property for each dependency artifact previously resolved.
(*__since 2.0__*) This is a link:../use/postresolvetask{outfilesuffix}[post resolve task], with all the behaviour and attributes common to all post resolve tasks.
Please prefer the use of retrieve + standard Ant path creation, which make your build more independent from Ivy (once artifacts are properly retrieved, Ivy is not required any more).
The property name and value are generated using the classical pattern concept, all artifact tokens and Ivy variables being available.
(*__since 2.0__*) This tag will follow the Ant usual behavior for properties. If a property with the same name already exists, its value will be unchanged. This behavior can be changed using the `overwrite` attribute.
_WARNING_: Before 2.0, the behavior was to overwrite the properties. Since 2.0, the default is to not overwrite to properties
== Attributes
[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|name|a pattern used to generate the name of the properties to set|Yes
|value|a pattern used to generate the value of the properties to set|Yes
|conf|a comma separated list of the configurations for which properties should be set|No. Defaults to the configurations resolved by the last resolve call, or `$$*$$` if no resolve was explicitly called
|haltonfailure|`true` to halt the build on Ivy failure, `false` to continue|No. Defaults to `true`
|validate|`true` to force validation of Ivy files against ivy.xsd, `false` to skip validation|No. Defaults to default Ivy value (as configured in settings file)
|settingsRef|A reference to Ivy settings that must be used by this task (*__since 2.0__*)|No, `ivy.instance` is taken by default.
|overwrite|Overwrite the value of the property if it already exists (*__since 2.0__*). Before 2.0, the properties were always overwritten.|No, `false` by default.
|=======
== Example
Suppose we have one dependency called `mydep` in revision 1.0 publishing two artifacts: `foo.jar` and `bar.jar`.
Then:
[source,xml]
----
<artifactproperty conf="build"
name="[module].[artifact]-[revision]"
value="${cache.dir}/[module]/[artifact]-[revision].[ext]"/>
----
will set two properties:
[source,properties]
----
mydep.foo-1.0 = my/cache/dir/mydep/foo-1.0.jar
mydep.bar-1.0 = my/cache/dir/mydep/bar-1.0.jar
----