ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r961685 [34/45] - in /ant/ivy/site/target/history/2.2.0-rc1: ./ configuration/ configuration/caches/ configuration/macrodef/ configuration/namespace/ dev/ images/ ivyfile/ js/ resolver/ samples/ settings/ settings/caches/ settings/macrodef/...
Date Thu, 08 Jul 2010 10:00:27 GMT
Added: ant/ivy/site/target/history/2.2.0-rc1/tutorial/build-repository/advanced.html
URL: http://svn.apache.org/viewvc/ant/ivy/site/target/history/2.2.0-rc1/tutorial/build-repository/advanced.html?rev=961685&view=auto
==============================================================================
--- ant/ivy/site/target/history/2.2.0-rc1/tutorial/build-repository/advanced.html (added)
+++ ant/ivy/site/target/history/2.2.0-rc1/tutorial/build-repository/advanced.html Thu Jul
 8 10:00:21 2010
@@ -0,0 +1,207 @@
+<!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: 2};</script>	
+	
+
+<title>Using namespaces | 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://ant.apache.org/">Apache Ant</a> &gt; <a href="http://ant.apache.org/ivy/">Ivy</a>
&gt; <a href="http://ant.apache.org/ivy/history.html">History</a> &gt;
<span class="breadCrumb"><a href="../../index.html" >Documentation (2.2.0-rc1)</a>
&gt; <a href="../../tutorial.html" >Tutorials</a> &gt; <a href="../../tutorial/build-repository.html"
>Building a repository</a> &gt; <a href="../../tutorial/build-repository/advanced.html"
class="current">Using namespaces</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>Ivy</h2>
+
+		<div class="content"><ul id="treemenu" class="treeview"><li id="xooki-index"
class="submenu"><a href="../../index.html" >Documentation (2.2.0-rc1)</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"
>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="open"><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"
class="current">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-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/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</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/modul
 es.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/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"
>c
 onf</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><l
 i 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/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/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/deliver"><a href="../../use/deliver.html" >deliver</a></li><li
id="xooki-use/findrevision"><a href="../../use/findrevision.html" >findrevision</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.h
 tml" >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/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></ul></li><li
id="xooki-d
 ev" 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><li
id="xooki-dev/updatesite"><a href="../../dev/updatesite.html" >Updating the updatesite</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">Using namespaces</h1>
+            <br class="xooki-br"/>Now that you have seen how simple it is to create
your own repository from an existing one, you may wonder how you can handle more complex cases,
when the source and destination repositories don't follow the same naming conventions for
instance. <br class="xooki-br"/><br class="xooki-br"/><br class="xooki-br"/><h1>On
the road to a professional repository</h1>
+We will study in this section how to build a <strong>professionnal</strong> repository.
What is a <strong>professionnal</strong> repository? Our vision is to say that
a good quality repository must follow clear rules about projects naming and must offer corrects,
usuables, configurables and verified project descriptors. In order to achieve those goals,
we think that you have to build your own repository.<br class="xooki-br"/>We have seen
in the previous example, that we could use some public repositories to begin to build our
own repository. <br class="xooki-br"/>Nevertheless, the result is not always the expected
one, especially concerning the naming rules used. <br class="xooki-br"/><br class="xooki-br"/>This
problem is pretty usual when you have an existing repository, and want to benefit from a large
public repositories which do not follow the same naming conventions. Or simply because you
find the public repository you use as a basis is not consistent enough - why all a
 pache commons module aren't don't use the org.apache.commons organization? For historical
reasons. But if you setup your own repository you may not want to suffer from history.<br
class="xooki-br"/><br class="xooki-br"/>Fortunately Ivy has a very powerful answer
to this kind of problem: <a href="../../settings/namespaces.html">namespaces</a>.<br
class="xooki-br"/><br class="xooki-br"/><h1>Using namespaces</h1>
+If you look at the repository built with the <a href="../../tutorial/build-repository/basic.html">previous
tutorial</a>, you will see exactly what we were talking about: all apache commons module
use their own name as organization.<br class="xooki-br"/><br class="xooki-br"/>So
let's see what Ivy can do using namespaces (we will dig into details later):
+<div class="shell"><pre>
+[ivy@apache:/ivy/build-a-ivy-repository]$ ant maven2-namespace
+Buildfile: /ivy/build-a-ivy-repository/build.xml
+
+load-ivy:
+
+init-ivy:
+
+maven2-namespace:
+[ivy:install] :: Ivy 2.2.0-rc1 - 20100629224905 :: http://ant.apache.org/ivy/ ::
+[ivy:install] :: loading settings :: file = /ivy/build-a-ivy-repository/settings/ivysettings-advanced.xml
+[ivy:install] DEPRECATED: 'defaultCache' is deprecated, use 'caches[@defaultCacheDir]' instead
(file://ivy/build-a-ivy-repository/settings/ivysettings-advanced.xml)
+[ivy:install] :: installing apache#commons-lang;1.0 ::
+[ivy:install] :: resolving dependencies ::
+[ivy:install] 	found apache#commons-lang;1.0 in libraries
+[ivy:install] :: downloading artifacts to cache ::
+[ivy:install] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/1.0/commons-lang-1.0.jar
...
+[ivy:install] .......................................................................................................................
(62kB)
+[ivy:install] .. (0kB)
+[ivy:install] 	[SUCCESSFUL ] apache#commons-lang;1.0!commons-lang.jar (1919ms)
+[ivy:install] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/1.0/commons-lang-1.0-javadoc.jar
...
+[ivy:install] ....................................................................................................................................................................................................................................................................................................................................................................
(170kB)
+[ivy:install] .. (0kB)
+[ivy:install] 	[SUCCESSFUL ] apache#commons-lang;1.0!commons-lang.jar(javadoc) (3478ms)
+[ivy:install] :: installing in my-repository ::
+[ivy:install] 	published commons-lang to /ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/jars/commons-lang-1.0.jar
+[ivy:install] 	published commons-lang to /ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/javadocs/commons-lang-1.0.jar
+[ivy:install] 	published ivy to /ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/ivys/ivy-1.0.xml
+[ivy:install] :: install resolution report ::
+[ivy:install] :: resolution report :: resolve 0ms :: artifacts dl 5428ms
+	---------------------------------------------------------------------
+	|                  |            modules            ||   artifacts   |
+	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
+	---------------------------------------------------------------------
+	|      default     |   1   |   1   |   1   |   0   ||   2   |   2   |
+	---------------------------------------------------------------------
+
+BUILD SUCCESSFUL
+Total time: 9 seconds
+
+</pre></div>
+
+Now if we look at our repository, it seems to look fine.
+<div class="shell"><pre>
+$ find /ivy/build-a-ivy-repository/myrepository/advanced -type f -print
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/ivys/ivy-1.0.xml
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/ivys/ivy-1.0.xml.md5
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/ivys/ivy-1.0.xml.sha1
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/jars/commons-lang-1.0.jar
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/jars/commons-lang-1.0.jar.md5
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/jars/commons-lang-1.0.jar.sha1
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/javadocs/commons-lang-1.0.jar
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/javadocs/commons-lang-1.0.jar.md5
+/ivy/build-a-ivy-repository/myrepository/advanced/apache/commons-lang/javadocs/commons-lang-1.0.jar.sha1
+
+</pre></div>
+We can even have a look at the commons-lang ivy file in our repo:
+<div><pre>
+&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br class="xooki-br"/>&lt;ivy-module
version="1.0"&gt;<br class="xooki-br"/>	&lt;info organisation="apache"<br
class="xooki-br"/>		module="commons-lang"<br class="xooki-br"/>		revision="1.0"<br
class="xooki-br"/>		status="integration"<br class="xooki-br"/>		publication="20051124062021"<br
class="xooki-br"/>		namespace="ibiblio-maven2"<br class="xooki-br"/>	/&gt;<br
class="xooki-br"/><br class="xooki-br"/>...
+</pre></div>
+Allright, we see that the organization is now 'apache'. But where did Ivy picked this up?<br
class="xooki-br"/><h2>How does this work ?</h2>
+Actually Ivy uses the same repository as before as source repository, with only one difference:
the namespace parameter:
+<pre>
+&lt;ibiblio	name="libraries" <br class="xooki-br"/>    root="${ibiblio-maven2-root}"
<br class="xooki-br"/>    m2compatible="true"<br class="xooki-br"/>    namespace="maven2"<br
class="xooki-br"/>/&gt;
+</pre>
+
+A namespace is defined by a set of rules. These rules are based on regular expressions and
tell Ivy how to convert data from the repository namespace from and to what is called the
system namespace, i.e. the namespace in which Ivy runs most of the time (Ivy cache is always
using the system namespace for instance).<br class="xooki-br"/><br class="xooki-br"/>For
the namespace we call maven2, we have declared some rules, here is one:<br class="xooki-br"/><h3>rule
handling imported apache maven1 projects</h3>
+<pre>&lt;rule&gt;	&lt;!-- imported apache maven1 projects --&gt;<br
class="xooki-br"/>	&lt;fromsystem&gt;<br class="xooki-br"/>	    &lt;src
org="apache" module=".+"/&gt;<br class="xooki-br"/>	    <br class="xooki-br"/>
    &lt;dest org="$m0" module="$m0"/&gt;<br class="xooki-br"/>	&lt;/fromsystem&gt;<br
class="xooki-br"/>	&lt;tosystem&gt;<br class="xooki-br"/>	    &lt;src
org="commons-.+" module="commons-.+" /&gt;<br class="xooki-br"/>	    &lt;src
org="ant.*" module="ant.*" /&gt;<br class="xooki-br"/>	    ...<br class="xooki-br"/>
    &lt;src org="xmlrpc" module="xmlrpc" /&gt;<br class="xooki-br"/><br class="xooki-br"/>
    &lt;dest org="apache" module="$m0"/&gt;<br class="xooki-br"/>	&lt;/tosystem&gt;<br
class="xooki-br"/>&lt;/rule&gt;</pre>
+<div class="postit"><u>Note about regular expressions usage :</u>
+In order to distinguish matching regular expressions found in organization, module and revision
the notation used prefixes the matching regular expression with the letters 'o', 'm' and 'r'.<br
class="xooki-br"/>$o0 : the whole matching value in the organization attribute<br class="xooki-br"/>$o1
: the first matching expression group that was marked in the organization attribute<br
class="xooki-br"/>...<br class="xooki-br"/>The same applies for modules : $m0, $m1,
...<br class="xooki-br"/>and for revisions : $r0, $r1, ...
+</div>
+To understand namespaces, 
+<ul>
+<li><b>fromsystem :</b> we define here that the projects defined in the
system namespace under the organization called "apache" are transformed into the destination
namespace into projects whose organization is named with the module name, whatever the revision
is. For example, the project apache#commons-lang;1.0  in the system namespace will be translated
into commons-lang#commons-lang;1.0 in the maven2 resolver namespace.</li>
+<li><b>tosystem :</b> we define here the reverse mapping, ie how to translate
<em>apache</em> projects from maven 2 repo into apache projects in the system
namespace. The rule used here tells that all projects matching commons-.+ (see it as java
regular expression) for their organization name and module name are transformed into projects
whose organisation is apache with the module name as it was found. The same kind of rule is
applied for others apache projects like ant, etc.</li>
+</ul>
+
+Ok, you should now get the idea behind namespace, you can now check the whole namespace settings
provided in the example, and test the installation of a module and its dependencies using
namespaces.<br class="xooki-br"/><br class="xooki-br"/>Run <pre>ant maven2-namespace-deps</pre>
and you will see the resulting repository is cleaner than the first one we built.<br class="xooki-br"/><br
class="xooki-br"/>From our experience investing in creating a namespace is worth the time
it costs if you often need to add new modules or revisions of third party libraries in your
own repository, where naming rules are already existing or rather strict. 
+ 		</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"></div>
+
+
+</div><!-- body -->
+</body>
+</html>

Propchange: ant/ivy/site/target/history/2.2.0-rc1/tutorial/build-repository/advanced.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message