////
   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.4__*]

The `artifactreport` task generates an XML report of all artifact dependencies resolved by the last link:../use/resolve{outfilesuffix}[resolve] task call during the same build.

(*__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.

This report is different from the standard link:../use/report{outfilesuffix}[report] which reports all modules and artifacts, while this report is much simpler and focuses only on artifacts, and gives more information on artifacts, such as the original location and the retrieve location.

It is thus easy to use to generate things like a classpath file for an IDE.

See this link:http://www.jaya.free.fr/ivy/doc/articles/ease-multi-module.html[article by Johan Stuyts] (who contributed this task) to see how he uses this task.

Here is an example of generated file:

[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<modules>
  <module organisation="hippo" name="sant-classes" rev="1.01.00b04-dev" status="integration">
    <artifact name="sant-classes-src" ext="zip" type="zip">
      <origin-location is-local="true">
        C:/home/jstuyts/data/ivy/local/hippo/sant-classes/1.01.00b04-dev/sant-classes-src-1.01.00b04-dev.zip</origin-location>
      <cache-location>
        C:/home/jstuyts/data/ivy/cache/hippo/sant-classes/zips/sant-classes-src-1.01.00b04-dev.zip</cache-location>
      <retrieve-location>lib/test/sant-classes-src-1.01.00b04-dev.zip</retrieve-location>
    </artifact>
    <artifact name="sant-classes-unoptimized" ext="jar" type="jar">
      <origin-location is-local="true">
        C:/home/jstuyts/data/ivy/local/hippo/sant-classes/1.01.00b04-dev/sant-classes-unoptimized-1.01.00b04-dev.jar</origin-location>
      <cache-location>
        C:/home/jstuyts/data/ivy/cache/hippo/sant-classes/jars/sant-classes-unoptimized-1.01.00b04-dev.jar</cache-location>
      <retrieve-location>lib/test/sant-classes-unoptimized-1.01.00b04-dev.jar</retrieve-location>
    </artifact>
  </module>
  <module organisation="testng" name="testng" rev="4.6.1-jdk15" status="release">
    <artifact name="testng" ext="jar" type="jar">
      <origin-location is-local="false">
        http://repository.hippocms.org/maven/testng/jars/testng-4.6.1-jdk15.jar</origin-location>
      <cache-location>C:/home/jstuyts/data/ivy/cache/testng/testng/jars/testng-4.6.1-jdk15.jar</cache-location>
      <retrieve-location>lib/test/testng-4.6.1-jdk15.jar</retrieve-location>
    </artifact>
  </module>
----

== Attributes

[options="header",cols="15%,50%,35%"]
|=======
|Attribute|Description|Required
|tofile|the file to which the report should be written|Yes
|pattern|the retrieve pattern to use for adding the retrieve location information about the artifacts|No. Defaults to `${ivy.retrieve.pattern}`.
|conf|a comma separated list of the configurations to use to generate the report|No. Defaults to the configurations resolved by the last resolve call
|haltonfailure|`true` to halt the build on Ivy failure, `false` to continue|No. Defaults to `true`
|settingsRef|A reference to Ivy settings that must be used by this task (*__since 2.0__*)|No, `ivy.instance` is taken by default.
|=======

== Examples

[source,xml]
----
<ivy:artifactreport tofile="${basedir}/path/to/myreport.xml"/>
----

Generates the artifact report for all configurations resolved during the last resolve call (in the same build).

[source,xml]
----
<ivy:artifactreport tofile="${basedir}/path/to/myreport.xml" conf="default"/>
----

Generates the artifact report for only the default configuration resolved during the last resolve call.
