You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2014/12/26 17:13:31 UTC
svn commit: r1647991 [12/12] - in /ant/site/ivy/production/history/2.4.0:
configuration/ configuration/caches/ configuration/macrodef/
configuration/namespace/ tutorial/ tutorial/build-repository/
Added: ant/site/ivy/production/history/2.4.0/tutorial/start.html
URL: http://svn.apache.org/viewvc/ant/site/ivy/production/history/2.4.0/tutorial/start.html?rev=1647991&view=auto
==============================================================================
--- ant/site/ivy/production/history/2.4.0/tutorial/start.html (added)
+++ ant/site/ivy/production/history/2.4.0/tutorial/start.html Fri Dec 26 16:13:30 2014
@@ -0,0 +1,297 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!--
+ 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.
+-->
+<html>
+<head>
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
+ <script type="text/javascript">var xookiConfig = {level: 1};</script>
+
+
+<title>Quick Start | Apache Ivy™</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="../style/style.css" />
+ <script src="../js/jquery.pack.js" type="text/javascript"></script>
+ <script src="../js/jquery.treeview.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ $(document).ready(function(){$("#treemenu").Treeview({speed: "fast",store: true});});
+ </script>
+
+<script language="javascript" type="text/javascript">xooki = {u: function(url) {return "../xooki/"+url;}};</script>
+</head>
+<body>
+
+<div id="body">
+<table id="header" summary="Navigation elements." border="0"
+ cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td id="home" width="30%"><a href="http://ant.apache.org/"
+ title="Apache Ant"><img src="../images/ant-group-logo.gif" alt="Apache Ant"
+ border="0" /></a></td>
+
+ <td class="product" width="70%" align="right" valign="middle"><img
+ src="../images/logo.png" alt="ivy" border="0" /></td>
+ </tr>
+</table>
+
+<table id="top-menu" summary="Navigation elements." border="0"
+ cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td>
+
+ <div style="float:right;margin: 0 10px;">
+ <!-- Google CSE Search Box Begins -->
+ <form id="searchbox_014292259695392975429:5y6qypnrni8" action="http://ant.apache.org/ivy/search.html">
+ <input type="hidden" name="cx" value="014292259695392975429:5y6qypnrni8" />
+ <input type="hidden" name="cof" value="FORID:11" />
+ <input name="q" type="text" size="30" />
+ <input type="submit" name="sa" value="Search" />
+ </form>
+ <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_014292259695392975429%3A5y6qypnrni8"></script>
+<!-- Google CSE Search Box Ends -->
+ </div>
+
+ <div id="navcontainer">
+ <a href="http://www.apache.org/">Apache™</a> > <a href="http://ant.apache.org/">Apache Ant™</a> > <a href="http://ant.apache.org/ivy/">Apache Ivy™</a> > <span class="breadCrumb"><a href="../index.html" >Documentation (2.4.0)</a> > <a href="../tutorial.html" >Tutorials</a> > <a href="../tutorial/start.html" class="current">Quick Start</a></span>
+ </div>
+ </td>
+ </tr>
+
+</table>
+
+<table id="content" border="0" cellpadding="0" cellspacing="0"
+ width="100%">
+ <tr>
+ <td id="sidebar-left">
+ <div class="block block-book" id="block-book-0">
+ <h2>Apache Ivy™</h2>
+
+ <div class="content"><ul id="treemenu" class="treeview">
+<li id="xooki-index" class="submenu"><a href="../index.html" >Documentation (2.4.0)</a><ul class="open"><li id="xooki-release-notes"><a href="../release-notes.html" >Release Notes</a></li>
+<li id="xooki-tutorial" class="submenu"><a href="../tutorial.html" >Tutorials</a><ul class="open"><li id="xooki-tutorial/start"><a href="../tutorial/start.html" class="current">Quick Start</a></li>
+<li id="xooki-tutorial/defaultconf"><a href="../tutorial/defaultconf.html" >Adjusting default settings</a></li>
+<li id="xooki-tutorial/multiple"><a href="../tutorial/multiple.html" >Multiple Resolvers</a></li>
+<li id="xooki-tutorial/dual"><a href="../tutorial/dual.html" >Dual Resolver</a></li>
+<li id="xooki-tutorial/dependence"><a href="../tutorial/dependence.html" >Project dependencies</a></li>
+<li id="xooki-tutorial/multiproject"><a href="../tutorial/multiproject.html" >Using Ivy in multiple projects environment</a></li>
+<li id="xooki-tutorial/conf"><a href="../tutorial/conf.html" >Using Ivy Module Configurations</a></li>
+<li id="xooki-tutorial/build-repository" class="submenu"><a href="../tutorial/build-repository.html" >Building a repository</a><ul class="closed"><li id="xooki-tutorial/build-repository/basic"><a href="../tutorial/build-repository/basic.html" >Basic repository copy</a></li>
+<li id="xooki-tutorial/build-repository/advanced"><a href="../tutorial/build-repository/advanced.html" >Using namespaces</a></li>
+</ul></li>
+<li id="xooki-moreexamples"><a href="../moreexamples.html" >More examples</a></li>
+</ul></li>
+<li id="xooki-reference" class="submenu"><a href="../reference.html" >Reference</a><ul class="closed"><li id="xooki-intro" class="submenu">Introduction<ul class="closed"><li id="xooki-terminology"><a href="../terminology.html" >Terminology</a></li>
+<li id="xooki-concept"><a href="../concept.html" >Main Concepts</a></li>
+<li id="xooki-textual"><a href="../textual.html" >Text Conventions</a></li>
+<li id="xooki-principle"><a href="../principle.html" >How does it work ?</a></li>
+<li id="xooki-bestpractices"><a href="../bestpractices.html" >Best practices</a></li>
+<li id="xooki-compatibility"><a href="../compatibility.html" >Compatibility</a></li>
+<li id="xooki-install"><a href="../install.html" >Installation</a></li>
+</ul></li>
+<li id="xooki-settings" class="submenu"><a href="../settings.html" >Settings Files</a><ul class="closed"><li id="xooki-settings/property"><a href="../settings/property.html" >property</a></li>
+<li id="xooki-settings/properties"><a href="../settings/properties.html" >properties</a></li>
+<li id="xooki-settings/settings"><a href="../settings/settings.html" >settings</a></li>
+<li id="xooki-settings/include"><a href="../settings/include.html" >include</a></li>
+<li id="xooki-settings/classpath"><a href="../settings/classpath.html" >classpath</a></li>
+<li id="xooki-settings/typedef"><a href="../settings/typedef.html" >typedef</a></li>
+<li id="xooki-settings/credentials"><a href="../settings/credentials.html" >credentials</a></li>
+<li id="xooki-settings/signers"><a href="../settings/signers.html" >signers</a></li>
+<li id="xooki-settings/lock-strategies"><a href="../settings/lock-strategies.html" >lock-strategies</a></li>
+<li id="xooki-settings/caches" class="submenu"><a href="../settings/caches.html" >caches</a><ul class="closed"><li id="xooki-settings/caches/cache" class="submenu"><a href="../settings/caches/cache.html" >cache</a><ul class="closed"><li id="xooki-settings/caches/ttl"><a href="../settings/caches/ttl.html" >ttl</a></li>
+</ul></li>
+</ul></li>
+<li id="xooki-settings/latest-strategies"><a href="../settings/latest-strategies.html" >latest-strategies</a></li>
+<li id="xooki-settings/parsers"><a href="../settings/parsers.html" >parsers</a></li>
+<li id="xooki-settings/namespaces" class="submenu"><a href="../settings/namespaces.html" >namespaces</a><ul class="closed"><li id="xooki-settings/namespace" class="submenu"><a href="../settings/namespace.html" >namespace</a><ul class="closed"><li id="xooki-settings/namespace/rule" class="submenu"><a href="../settings/namespace/rule.html" >rule</a><ul class="closed"><li id="xooki-settings/namespace/fromtosystem" class="submenu"><a href="../settings/namespace/fromtosystem.html" >fromsystem / tosystem</a><ul class="closed"><li id="xooki-settings/namespace/src"><a href="../settings/namespace/src.html" >src</a></li>
+<li id="xooki-settings/namespace/dest"><a href="../settings/namespace/dest.html" >dest</a></li>
+</ul></li>
+</ul></li>
+</ul></li>
+</ul></li>
+<li id="xooki-settings/macrodef" class="submenu"><a href="../settings/macrodef.html" >macrodef</a><ul class="closed"><li id="xooki-settings/macrodef/attribute"><a href="../settings/macrodef/attribute.html" >attribute</a></li>
+</ul></li>
+<li id="xooki-settings/resolvers" class="submenu"><a href="../settings/resolvers.html" >resolvers</a><ul class="closed"><li id="xooki-resolver/ivyrep"><a href="../resolver/ivyrep.html" >IvyRep Resolver</a></li>
+<li id="xooki-resolver/ibiblio"><a href="../resolver/ibiblio.html" >IBiblio Resolver</a></li>
+<li id="xooki-resolver/packager"><a href="../resolver/packager.html" >Packager resolver</a></li>
+<li id="xooki-resolver/filesystem"><a href="../resolver/filesystem.html" >File System resolver</a></li>
+<li id="xooki-resolver/url"><a href="../resolver/url.html" >Url Resolver</a></li>
+<li id="xooki-resolver/chain"><a href="../resolver/chain.html" >Chain Resolver</a></li>
+<li id="xooki-resolver/dual"><a href="../resolver/dual.html" >Dual resolver</a></li>
+<li id="xooki-resolver/sftp"><a href="../resolver/sftp.html" >sftp resolver</a></li>
+<li id="xooki-resolver/ssh"><a href="../resolver/ssh.html" >ssh resolver</a></li>
+<li id="xooki-resolver/vfs"><a href="../resolver/vfs.html" >vfs resolver</a></li>
+<li id="xooki-resolver/jar"><a href="../resolver/jar.html" >Jar resolver</a></li>
+<li id="xooki-resolver/obr"><a href="../resolver/obr.html" >OSGi Bundle Repository</a></li>
+<li id="xooki-resolver/osgiagg"><a href="../resolver/osgiagg.html" >Aggregated OSGi Repository</a></li>
+<li id="xooki-resolver/updatesite"><a href="../resolver/updatesite.html" >Eclipse updatesite</a></li>
+<li id="xooki-resolver/mirrored"><a href="../resolver/mirrored.html" >Mirrored Resolver</a></li>
+<li id="xooki-resolver/bintray"><a href="../resolver/bintray.html" >Bintray Resolver</a></li>
+</ul></li>
+<li id="xooki-settings/conflict-managers"><a href="../settings/conflict-managers.html" >conflict-managers</a></li>
+<li id="xooki-settings/modules" class="submenu"><a href="../settings/modules.html" >modules</a><ul class="closed"><li id="xooki-settings/module"><a href="../settings/module.html" >module</a></li>
+</ul></li>
+<li id="xooki-settings/outputters"><a href="../settings/outputters.html" >outputters</a></li>
+<li id="xooki-settings/signers"><a href="../settings/signers.html" >signers</a></li>
+<li id="xooki-settings/statuses" class="submenu"><a href="../settings/statuses.html" >statuses</a><ul class="closed"><li id="xooki-settings/status"><a href="../settings/status.html" >status</a></li>
+</ul></li>
+<li id="xooki-settings/triggers"><a href="../settings/triggers.html" >triggers</a></li>
+<li id="xooki-settings/version-matchers"><a href="../settings/version-matchers.html" >version-matchers</a></li>
+</ul></li>
+<li id="xooki-ivyfile" class="submenu"><a href="../ivyfile.html" >Ivy Files</a><ul class="closed"><li id="xooki-ivyfile/info" class="submenu"><a href="../ivyfile/info.html" >info</a><ul class="closed"><li id="xooki-ivyfile/extends"><a href="../ivyfile/extends.html" >extends</a></li>
+<li id="xooki-ivyfile/license"><a href="../ivyfile/license.html" >license</a></li>
+<li id="xooki-ivyfile/ivyauthor"><a href="../ivyfile/ivyauthor.html" >ivyauthor</a></li>
+<li id="xooki-ivyfile/repository"><a href="../ivyfile/repository.html" >repository</a></li>
+<li id="xooki-ivyfile/description"><a href="../ivyfile/description.html" >description</a></li>
+</ul></li>
+<li id="xooki-ivyfile/configurations" class="submenu"><a href="../ivyfile/configurations.html" >configurations</a><ul class="closed"><li id="xooki-ivyfile/conf"><a href="../ivyfile/conf.html" >conf</a></li>
+<li id="xooki-ivyfile/include"><a href="../ivyfile/include.html" >include</a></li>
+</ul></li>
+<li id="xooki-ivyfile/publications" class="submenu"><a href="../ivyfile/publications.html" >publications</a><ul class="closed"><li id="xooki-ivyfile/artifact" class="submenu"><a href="../ivyfile/artifact.html" >artifact</a><ul class="closed"><li id="xooki-ivyfile/artifact-conf"><a href="../ivyfile/artifact-conf.html" >conf</a></li>
+</ul></li>
+</ul></li>
+<li id="xooki-ivyfile/dependencies" class="submenu"><a href="../ivyfile/dependencies.html" >dependencies</a><ul class="closed"><li id="xooki-ivyfile/dependency" class="submenu"><a href="../ivyfile/dependency.html" >dependency</a><ul class="closed"><li id="xooki-ivyfile/dependency-conf" class="submenu"><a href="../ivyfile/dependency-conf.html" >conf</a><ul class="closed"><li id="xooki-ivyfile/mapped"><a href="../ivyfile/mapped.html" >mapped</a></li>
+</ul></li>
+<li id="xooki-ivyfile/dependency-artifact" class="submenu"><a href="../ivyfile/dependency-artifact.html" >artifact</a><ul class="closed"><li id="xooki-ivyfile/dependency-artifact-conf"><a href="../ivyfile/dependency-artifact-conf.html" >conf</a></li>
+</ul></li>
+<li id="xooki-ivyfile/artifact-exclude" class="submenu"><a href="../ivyfile/artifact-exclude.html" >exclude</a><ul class="closed"><li id="xooki-ivyfile/artifact-exclude-conf"><a href="../ivyfile/artifact-exclude-conf.html" >conf</a></li>
+</ul></li>
+<li id="xooki-ivyfile/dependency-include" class="submenu"><a href="../ivyfile/dependency-include.html" >include</a><ul class="closed"><li id="xooki-ivyfile/dependency-include-conf"><a href="../ivyfile/dependency-include-conf.html" >conf</a></li>
+</ul></li>
+</ul></li>
+<li id="xooki-ivyfile/exclude"><a href="../ivyfile/exclude.html" >exclude</a></li>
+<li id="xooki-ivyfile/override"><a href="../ivyfile/override.html" >override</a></li>
+<li id="xooki-ivyfile/conflict"><a href="../ivyfile/conflict.html" >conflict</a></li>
+</ul></li>
+<li id="xooki-ivyfile/conflicts" class="submenu"><a href="../ivyfile/conflicts.html" >conflicts</a><ul class="closed"><li id="xooki-ivyfile/manager"><a href="../ivyfile/manager.html" >manager</a></li>
+</ul></li>
+</ul></li>
+<li id="xooki-ant" class="submenu"><a href="../ant.html" >Ant Tasks</a><ul class="closed"><li id="xooki-use/artifactproperty"><a href="../use/artifactproperty.html" >artifactproperty</a></li>
+<li id="xooki-use/artifactreport"><a href="../use/artifactreport.html" >artifactreport</a></li>
+<li id="xooki-use/buildlist"><a href="../use/buildlist.html" >buildlist</a></li>
+<li id="xooki-use/buildobr"><a href="../use/buildobr.html" >buildobr</a></li>
+<li id="xooki-use/buildnumber"><a href="../use/buildnumber.html" >buildnumber</a></li>
+<li id="xooki-use/cachefileset"><a href="../use/cachefileset.html" >cachefileset</a></li>
+<li id="xooki-use/cachepath"><a href="../use/cachepath.html" >cachepath</a></li>
+<li id="xooki-use/checkdepsupdate"><a href="../use/checkdepsupdate.html" >checkdepsupdate</a></li>
+<li id="xooki-use/cleancache"><a href="../use/cleancache.html" >cleancache</a></li>
+<li id="xooki-use/configure"><a href="../use/configure.html" >configure</a></li>
+<li id="xooki-use/convertmanifest"><a href="../use/convertmanifest.html" >convertmanifest</a></li>
+<li id="xooki-use/convertpom"><a href="../use/convertpom.html" >convertpom</a></li>
+<li id="xooki-use/deliver"><a href="../use/deliver.html" >deliver</a></li>
+<li id="xooki-use/dependencytree"><a href="../use/dependencytree.html" >dependencytree</a></li>
+<li id="xooki-use/findrevision"><a href="../use/findrevision.html" >findrevision</a></li>
+<li id="xooki-use/fixdeps"><a href="../use/fixdeps.html" >fixdeps</a></li>
+<li id="xooki-use/info"><a href="../use/info.html" >info</a></li>
+<li id="xooki-use/install"><a href="../use/install.html" >install</a></li>
+<li id="xooki-use/listmodules"><a href="../use/listmodules.html" >listmodules</a></li>
+<li id="xooki-use/makepom"><a href="../use/makepom.html" >makepom</a></li>
+<li id="xooki-use/postresolvetask"><a href="../use/postresolvetask.html" >post resolve tasks</a></li>
+<li id="xooki-use/publish"><a href="../use/publish.html" >publish</a></li>
+<li id="xooki-use/repreport"><a href="../use/repreport.html" >repreport</a></li>
+<li id="xooki-use/resolve"><a href="../use/resolve.html" >resolve</a></li>
+<li id="xooki-use/resources"><a href="../use/resources.html" >resources</a></li>
+<li id="xooki-use/retrieve"><a href="../use/retrieve.html" >retrieve</a></li>
+<li id="xooki-use/report" class="submenu"><a href="../use/report.html" >report</a><ul class="closed"><li id="xooki-yed"><a href="../yed.html" >Using yEd to layout report graphs</a></li>
+</ul></li>
+<li id="xooki-use/settings"><a href="../use/settings.html" >settings</a></li>
+<li id="xooki-use/var"><a href="../use/var.html" >var</a></li>
+</ul></li>
+<li id="xooki-standalone"><a href="../standalone.html" >Using standalone</a></li>
+<li id="xooki-osgi" class="submenu"><a href="../osgi.html" >OSGi</a><ul class="closed"><li id="xooki-osgi/osgi-mapping"><a href="../osgi/osgi-mapping.html" >OSGi mapping</a></li>
+<li id="xooki-osgi/eclipse-plugin"><a href="../osgi/eclipse-plugin.html" >Building an Eclipse plugin</a></li>
+<li id="xooki-osgi/standard-osgi"><a href="../osgi/standard-osgi.html" >Building a standard OSGi bundle</a></li>
+<li id="xooki-osgi/target-platform"><a href="../osgi/target-platform.html" >Managing a target platform</a></li>
+<li id="xooki-osgi/sigil"><a href="../osgi/sigil.html" >Apache Felix Sigil</a></li>
+</ul></li>
+</ul></li>
+<li id="xooki-dev" class="submenu"><a href="../dev.html" >Developer doc</a><ul class="closed"><li id="xooki-extend"><a href="../extend.html" >Extending Ivy</a></li>
+<li id="xooki-dev/makerelease"><a href="../dev/makerelease.html" >Making a release</a></li>
+</ul></li>
+</ul></li>
+</ul>
+</div>
+
+ <center><iframe src="http://www.apache.org/ads/buttonbar.html"
+ style="border-width:0;" frameborder="0" scrolling="no"
+ width="135" height="265"></iframe>
+ </center>
+
+ </div>
+
+ </td>
+
+ <td valign="top">
+ <div id="main">
+
+ <h1 class="title">Quick Start</h1>
+ <br class="xooki-br"/>In this tutorial, you will see one of the simplest ways to use Ivy. With no specific settings, Ivy uses the maven 2 repository to resolve the dependencies you declare in an Ivy file. Let's have a look at the content of the files involved. <br class="xooki-br"/><br class="xooki-br"/><em>You'll find this tutorial's sources in the ivy distribution in the src/example/hello-ivy directory.</em><br class="xooki-br"/><br class="xooki-br"/><h1>The ivy.xml file</h1>
+This file is used to describe the dependencies of the project on other libraries.<br class="xooki-br"/>Here is the sample:
+<pre>
+<ivy-module version="2.0"><br class="xooki-br"/> <info organisation="org.apache" module="hello-ivy"/><br class="xooki-br"/> <dependencies><br class="xooki-br"/> <dependency org="commons-lang" name="commons-lang" rev="2.0"/><br class="xooki-br"/> <dependency org="commons-cli" name="commons-cli" rev="1.0"/><br class="xooki-br"/> </dependencies><br class="xooki-br"/></ivy-module>
+</pre>
+
+The format of this file should pretty easy to understand, but let's give some details about what is declared here. First, the root element ivy-module, with the version attribute used to tell Ivy which version of Ivy this file uses. <br class="xooki-br"/><br class="xooki-br"/>Then there is an info tag, which is used to give information about the module for which we are defining dependencies. Here we define only the organization and module name. You are free to choose whatever you want for them, but we recommend avoiding spaces for both.<br class="xooki-br"/><br class="xooki-br"/>Finally, the dependencies section lets you define dependencies. Here this module depends on two libraries: commons-lang and commons-cli. As you can see, we use the <tt>org</tt> and <tt>name</tt> attributes to define the organization and module name of the dependencies we need. The <tt>rev</tt> attribute is used to specify the version of the module you depend on. <br class="xooki-br"/><br class="xooki-br"/>To
know what to put in these attributes, you need to know the exact information for the libraries you depend on. Ivy uses the maven 2 repository by default, so we recommend you use <a href="http://mvnrepository.com">mvnrepository.com</a> to look for the module you want. Once you find it, you will have the details on how to declare the dependency in a maven POM. For instance:
+<pre>
+<dependency><br class="xooki-br"/> <groupId>commons-lang</groupId><br class="xooki-br"/> <artifactId>commons-lang</artifactId><br class="xooki-br"/> <version>2.0</version><br class="xooki-br"/></dependency>
+</pre>
+To convert this into an Ivy dependency declaration, all you have to do is use the groupId as organization, the artifactId as module name, and the version as revision. That's what we did for the dependencies in this tutorial, that is commons-lang and commons-cli. Note that having commons-lang and commons-cli as organization is not the best example of what the organization should be. It would be better to use org.apache, org.apache.commons or org.apache.commons.lang. However, this is how these modules are identified in the maven 2 repository, so the simplest way to get them is to use the details as is (you will see in <a href="../tutorial/build-repository.html">Building a repository</a> that you can use namespaces to redefine these names if you want something cleaner).<br class="xooki-br"/><br class="xooki-br"/>If you want more details on what you can do in Ivy files, you can have a look at the <a href="../ivyfile.html">Ivy files reference documentation</a>.<br class="xooki-br"/><h1>T
he build.xml file</h1>
+The corresponding build file contains a set of targets, allowing you to resolve dependencies declared in the Ivy file, to compile and run the sample code, produce a report of dependency resolution, and clean the cache or the project.<br class="xooki-br"/>You can use the standard "ant -p" to get the list of available targets. Feel free to have a look at the whole file, but here is the part relevant to dependency resolution:
+<pre>
+<project xmlns:ivy="antlib:org.apache.ivy.ant" name="hello-ivy" default="run"><br class="xooki-br"/> <br class="xooki-br"/> ...<br class="xooki-br"/> <br class="xooki-br"/> <!-- ================================= <br class="xooki-br"/> target: resolve <br class="xooki-br"/> ================================= --><br class="xooki-br"/> <target name="resolve" description="--> retrieve dependencies with ivy"><br class="xooki-br"/> <ivy:retrieve /><br class="xooki-br"/> </target><br class="xooki-br"/></project>
+</pre>
+As you can see, it's very easy to call Ivy to resolve and retrieve dependencies: all you need if Ivy is properly <a href="../install.html">installed</a> is to define an XML namespace in your Ant file (xmlns:ivy="antlib:org.apache.ivy.ant"). Then all the <a href="../ant.html">Ivy ant tasks</a> will be available in this namespace.<br class="xooki-br"/><br class="xooki-br"/>Here we use only one task: the <a href="../use/retrieve.html">retrieve</a> task. With no attributes, it will use default settings and look for a file named <tt>ivy.xml</tt> for the dependency definitions. That's exactly what we want, so we need nothing more than that.<br class="xooki-br"/><br class="xooki-br"/>Note that in this case we define a <tt>resolve</tt> target and call the <tt><a href="../use/retrieve.html">retrieve</a></tt> task. This may sound confusing, actually the retrieve task performs a <a href="../use/resolve.html">resolve</a> (which resolves dependencies and downloads them to a cache) followed by a
retrieve (a copy of those file to a local project directory). Check the <a href="../principle.html">How does it work ?</a> page for details about that.<br class="xooki-br"/><h1>Running the project</h1>
+OK, now that we have seen the files involved, let's run the sample to see what happens. Open a shell (or command line) window, and enter the <tt>hello-ivy</tt> example directory.<br class="xooki-br"/>Then, at the command prompt, run <tt>ant</tt>:
+<div class="shell"><pre>
+
+</pre></div>
+<h1>What happened ?</h1>
+Without any settings, Ivy retrieves files from the maven 2 repository. That's what happened here. <br class="xooki-br"/>The resolve task has found the commons-lang and commons-cli modules in the maven 2 repository, identified that commons-cli depends on commons-logging and so resolved it as a transitive dependency. Then Ivy has downloaded all corresponding artifacts in its cache (by default in your user home, in a .ivy2/cache directory). Finally, the retrieve task copies the resolved jars from the ivy cache to the default library directory of the project: the lib dir (you can change this easily by setting the pattern attribute on the <a href="../use/retrieve.html">retrieve</a> task).<br class="xooki-br"/><br class="xooki-br"/>You might say that the task took a long time just to write out a "Hello Ivy!" message. But remember that a lot of time was spent downloading the required files from the web. Let's try to run it again:
+<div class="shell"><pre>
+
+</pre></div>
+Great! The cache was used, so no download was needed and the build was instantaneous.<br class="xooki-br"/><br class="xooki-br"/>And now, if you want to generate a report detailing all the dependencies of your module, you can call the report target, and check the generated file in the build directory. You should obtain something looking like <a href="../samples/apache-hello-ivy-default.html">this</a>.<br class="xooki-br"/><br class="xooki-br"/>As you can see, using Ivy to resolve dependencies stored in the maven 2 repository is extremely easy. Now you can go on with the next tutorials to learn more about <a href="../tutorial/conf.html">how to use module configurations</a> which is a very powerful Ivy specific feature. Other tutorials are also available where you will learn how to use Ivy settings to leverage a possibly complex enterprise repository. It may also be a good time to start reading the <a href="../reference.html">reference documentation</a>, and especially the introductio
n material which gives a good overview of Ivy. The <a href="../bestpractices.html">best practices</a> page is also a must read to start thinking about how to use Ant+Ivy to build a clean and robust build system.
+ </div><!-- main -->
+ </td>
+ </tr>
+</table>
+
+<table id="footer-menu" summary="Navigation elements." border="0"
+ cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td align="center" valign="middle">
+ <div class="primary-links">::
+ <a href="../index.html">Home</a> ::
+ <a href="../download.html">Download</a> ::
+ <a href="../history/latest-milestone/index.html">Documentation</a> ::
+ <a href="../get-involved.html">Get Involved</a> ::
+ <a href="../search.html">Search</a> ::
+ </div>
+ </td>
+ </tr>
+</table>
+
+<div id="footer-message" class="footer">
+ <hr />
+ <i>Copyright © 2014 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a>.</i><br />
+ <i>Apache Ivy, Apache Ant, Ivy, Ant, Apache, the Apache Ivy logo, the Apache Ant logo and the Apache feather logo are trademarks of The Apache Software Foundation.</i><br />
+ <i>All other marks mentioned may be trademarks or registered trademarks of their respective owners. </i>
+</div>
+
+</div><!-- body -->
+</body>
+</html>
Propchange: ant/site/ivy/production/history/2.4.0/tutorial/start.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/site/ivy/production/history/2.4.0/tutorial/start.html
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: ant/site/ivy/production/history/2.4.0/tutorial/start.html
------------------------------------------------------------------------------
svn:mime-type = text/html