------ Task and Type Reference ------ Brett Porter Hervé Boutemy ------ 2008-07-17 ------ ~~ 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 ~~ ~~ http://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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html {Task} Reference ~~ TODO: Can the task and type classes be generated using Modello? ~~ If so, the reference documentation can be generated from the model. * <<<{dependencies}>>> This task will check if any of the specified dependencies, and their dependencies are missing or updated, and download them if necessary. The dependencies will be made available as a fileset or path reference. The dependencies task accepts the following attributes: *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <> | <> | <> | << Since >> | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | The reference ID to store a fileset under, for the resolved dependencies. | No | | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | The reference ID to store a fileset under, for the javadoc attachements of the resolved dependencies. | No | 2.0.9 | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | The reference ID to store a path under, for the resolved dependencies. | No | | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | The reference ID from a POM datatype defined earlier in the build file. | Yes, either this or a <<>> nested element or one or more <<>> nested elements | | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | The settings file to use. Defaults to <<<$\{user.home\}/.ant/settings.xml>>> or if that doesn't exist <<<$\{user.home\}/.m2/settings.xml>>>. | No | 2.0.6 | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | The reference ID to store a fileset under, for the sources attachements of the resolved dependencies. | No | 2.0.6 | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | A comma separated list of artifact types to be retrieved. By default all artifact types will be included. | No | | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | Follows the maven scope behaviour. Can be set to <<>>, <<>>, or <<>>. If no value is provided, all scopes will be included. | No | | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | A comma separated list of specific scopes to be retrieved. If no value is provided, all scopes will be included. | No | 2.0.10 | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | If <<>> this displays the results of each dependency resolution and their relationships. Default is . | No | | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | The property ID to store the versions of the resolved dependencies, for use by a {{{reference.html#VersionMapper} <<>>}}. | No | 2.0.7 | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ | <<>> | If set to true, will add a fileset for each resolved dependency. The fileset has an id of <<>>. Default is . | No | 2.0.10 | *-------------------------+---------------------------------------------------------------------------+--------------+-------------+ The task can include the <<>> nested type, in addition to the other shared types {{{reference.html#localRepository} <<>>}}, {{{reference.html#pom} <<>>}} and {{{reference.html#remoteRepository} <<>>}}, which will be explained later. You must include either a single <<>> element or a <<>> attribute or one or more <<>> elements. If you have set a value for <<>>, you can later use {{{reference.html#versionMapper} <<>>}}. <(since 2.0.8)> For each dependency resolved, the property <<>> is defined pointing to the corresponding file. ** <<>> ~~ TODO: Is system scope supported, in the table below? *------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *------------------+--------------------------------------------------------+--------------+ | <<>> | The group ID of the dependency. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | The artifact ID of the dependency. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | The version of the dependency. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | The type of the dependency. The default is <<>>. | No | *------------------+--------------------------------------------------------+--------------+ | <<>> | The scope of the usage of the dependency, which affects which of that dependency's own dependencies are also retrieved. This can be <<>>, <<>>, <<>>, <<>>. | No | *------------------+--------------------------------------------------------+--------------+ The dependency can also nest multiple <<>> elements. *** <<>> An exclusion can be used to prevent the resolution of a particular artifact in the tree of the <<>>. *------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *------------------+--------------------------------------------------------+--------------+ | <<>> | The group ID of the dependency to exclude. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | The artifact ID of the dependency to exclude. | Yes | *------------------+--------------------------------------------------------+--------------+ * <<<{install}>>>, <<<{deploy}>>> These tasks will install/deploy the given file into the local/remote repository. It is stored using the information in the supplied POM. Multiple artifacts can be attached during install/deploy using <<>> elements. *---------------------+--------------------------------------------------------------------------+-------------------------------------------------+-------------+ | <> | <> | <> | << Since >> | *---------------------+--------------------------------------------------------------------------+-------------------------------------------------+-------------+ | <<>> | The file to install in the repository. | Yes, except if packaging is <<>> | | *---------------------+--------------------------------------------------------------------------+-------------------------------------------------+-------------+ | <<>> | The reference ID from a POM datatype defined earlier in the build file. | No, if a <<>> nested element is provided instead | | *---------------------+--------------------------------------------------------------------------+-------------------------------------------------+-------------+ | <<>> | The settings file to use. Defaults to <<<$\{user.home\}/.ant/settings.xml>>> or if that doesn't exist <<<$\{user.home\}/.m2/settings.xml>>>. | No | 2.0.6 | *---------------------+--------------------------------------------------------------------------+-------------------------------------------------+-------------+ | <<>> | (<<>> only) Whether to assign snapshots a unique version comprised of the timestamp and build number, or to use the same version each time | No, the default is <<>>. | | *---------------------+--------------------------------------------------------------------------+-------------------------------------------------+-------------+ The task must take either a nested {{{reference.html#pom} <<>>}} element, or a <<>> attribute. Both release and <<<-SNAPSHOT>>> versions are supported. The task can have an optional {{{reference.html#localRepository} <<>>}} nested element. <<>> can have an optional {{{reference.html#remoteRepository} <<>>}} nested element. If no <<>> nested element is given, the <<>> section of the POM is used. ** <<>> <(since 2.0.6)> Multiple artifacts can be attached to the main artifact, for example: sources, javadocs, ... *------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *------------------+--------------------------------------------------------+--------------+ | <<>> | The file to attach. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | The type of the file. Defaults to <<>>. | No | *------------------+--------------------------------------------------------+--------------+ | <<>> | The classifier of the file. | No | *------------------+--------------------------------------------------------+--------------+ * <<<{install-provider}>>> This task will install a Wagon provider, to add support for more protocols. *------------------+--------------------------------------------------------------------------+--------------+-------------+ | <> | <> | <> | << Since >> | *------------------+--------------------------------------------------------------------------+--------------+-------------+ | <<>> | The artifact ID of the provider to install. | Yes | | *------------------+--------------------------------------------------------------------------+--------------+-------------+ | <<>> | The group ID of the provider to install. The default is <<>>. | No | 2.0.7 | *------------------+--------------------------------------------------------------------------+--------------+-------------+ | <<>> | The version of the provider to install. | Yes | | *------------------+--------------------------------------------------------------------------+--------------+-------------+ {Type} Reference * <<<{localRepository}>>> Specifies the location of the local repository of artifacts. ~~ TODO: id/refid *------------------+--------------------------------------------------------+--------------+-------------+ | <> | <> | <> | << Since >> | *------------------+--------------------------------------------------------+--------------+-------------+ | <<>> | The layout of the local repository. The valid options are <<>> (Maven 1), or <<>> (Maven 2). Defaults to <<>>. | No | | *------------------+--------------------------------------------------------+--------------+-------------+ | <<>> | The directory of the local repository. | Yes | 2.0.7 | *------------------+--------------------------------------------------------+--------------+-------------+ <>: until 2.0.6, attribute <<>> was named <<>>, but this changed in 2.0.7 to solve a conflict with Ant 1.7. * <<<{remoteRepository}>>> Specifies the location of the remote repository. ~~ TODO: id/refid *----------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *----------------------+--------------------------------------------------------+--------------+ | <<>> | A unique ID of the repository. | Yes | *----------------------+--------------------------------------------------------+--------------+ | <<>> | The URL of the repository. | Yes | *----------------------+--------------------------------------------------------+--------------+ | <<>> | The layout of the remote repository. The valid options are <<>> (Maven 1), or <<>> (Maven 2). Defaults to <<>>. | No | *----------------------+--------------------------------------------------------+--------------+ The <<>> can have the following nested elements: <<>>, <<>>, <<>> and <<>>. ** <<>>, <<>> Policies about downloading different types of artifacts. *----------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *----------------------+--------------------------------------------------------+--------------+ | <<>> | How to treat missing or incorrect checksums for the dependencies that are downloaded. Valid values are <<>> () and <<>>. | No | *----------------------+--------------------------------------------------------+--------------+ | <<>> | Whether to download this type of artifact from the repository. Default is <<>>. | No | *----------------------+--------------------------------------------------------+--------------+ | <<>> | How often to check for updates on dependencies that are snapshots or include a range of versions. Valid values are <<>>, <<>>, <<>> (), <<>>. | No | *----------------------+--------------------------------------------------------+--------------+ ** <<>> The authentication element is used for passing a username, password and other credentials to the repository either on upload or download. The content is the same as for <<>> in the {{{http://maven.apache.org/maven-settings/settings.html#class_server} settings reference}}. ** <<>> The proxy element is typically used for HTTP repositories. The content is the same as for <<>> in the {{{http://maven.apache.org/maven-settings/settings.html#class_proxy} settings reference}}. * <<<{pom}>>> The POM element will load a POM file and make it available as a reference for the other tasks or as properties. *------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *------------------+--------------------------------------------------------+--------------+ | <<>> | The file of the POM to load. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | The reference ID of this POM. | No | *------------------+--------------------------------------------------------+--------------+ | <<>> | The settings file to use. Defaults to <<<$\{user.home\}/.ant/settings.xml>>> or if that doesn't exist <<<$\{user.home\}/.m2/settings.xml>>>. | No | 2.0.6 | *---------------------+--------------------------------------------------------------------------+-------------------------------------------------+-------------+ ** <<>> <(since 2.0.10)> Multiple profile elements can be nested within the pom element. By default the profile will be activated. If <> is set to false, then the profile will be explicitly deactivated. *------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *------------------+--------------------------------------------------------+--------------+ | <<>> | The id of the profile to be activated/deactivated. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | Set to <<>> or <<>> to determine whether the profile should be active. Default is <<>>. | No | *------------------+--------------------------------------------------------+--------------+ * <<<{versionMapper}>>> <(since 2.0.7)> This is a {{{http://ant.apache.org/manual/CoreTypes/mapper.html}filename mapper}} that removes version info from the filename when copying dependencies. It can also, optionally, remove the directory info from the filename. The full class name to use in <<>> attribute of <<<\>>> element is <<>>. *------------------+--------------------------------------------------------+--------------+ | <> | <> | <> | *------------------+--------------------------------------------------------+--------------+ | <<>> | The versions of the dependencies, as set by <<>> attribute of <<>> task. | Yes | *------------------+--------------------------------------------------------+--------------+ | <<>> | If this is set to <<>> the directory info is also removed from the filename. | No | *------------------+--------------------------------------------------------+--------------+ You can see a full working example in the {{{examples/dependencies.html} examples}}.