`

ivy教程(10)-架设仓库(2)-基础仓库复制

阅读更多


    在这个步骤中我们使用install任务来从maven2 仓库安装模块到一个基于文件系统的仓库。我们首先安装一个不带依赖的模块,然后安装一个带有依赖的模块。

    1) 基础: 使用ivysettings.xml文件

    这里我们使用的ivy设置文件非常简单。它定义两个解析器,libraries 和 my-repository. 第一个作为源使用,第二个作为目的地。在典型的安装中第二个仓库将使用包含设置来配置,被这个开发团队使用。

< ivysettings >
    
< settings     defaultCache ="${ivy.cache.dir}/no-namespace"    
            defaultResolver
="libraries"
            defaultConflictManager
="all"   />          <!--  in order to get all revisions without any eviction  -->
    
< resolvers >
        
< ibiblio  name ="libraries"  m2compatible ="true"   />
          
< filesystem  name ="my-repository" >
              
< ivy  pattern ="${dest.repo.dir}/no-namespace/[organisation]/[module]/ivys/ivy-[revision].xml" />
              
< artifact  pattern ="${dest.repo.dir}/no-namespace/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]" />
          
</ filesystem >
    
</ resolvers >
</ ivysettings >


    2) 安装不带依赖的简单模块

    让我们看一下maven2 target

    < target  name ="maven2"  depends ="init-ivy"
        description
="--> install module from maven 2 repository" >
        
< ivy:install  settingsRef ="basic.settings"
            organisation
="commons-lang"  module ="commons-lang"  revision ="1.0"
            from
="${from.resolver}"  to ="${to.resolver}"   />
    
</ target >


    很简单,我们使用和以往一样用ivy:settings装载的设置来调用[ant:install] 任务,我们通过使用属性提供fromResolver (源) 和 toResolver (目的) 来简化脚本的维护。我们的解析器主要是:'libraries' 作为源而'my-repository'作为目的地.

    这是ant调用的输出:

Z:\>ant maven2
Buildfile: build.xml

load-ivy:

init-ivy:

maven2:
[ivy:install] :: loading settings :: url = jar:file://home/xavier/.ivy2/jars/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:install] :: Ivy 2.0.0-beta1-local-20071130005044 - 20071130005044 :: http://ant.apache.org/ivy/ ::
:: loading settings :: file = /home/xavier/ivy/settings/ivysettings-advanced.xml
[ivy:install] :: installing commons-lang#commons-lang;1.0 ::
[ivy:install] :: resolving dependencies ::
[ivy:install]   found commons-lang#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 ] commons-lang#commons-lang;1.0/commons-lang.jar[jar] (2464ms)
[ivy:install] :: installing in my-repository ::
[ivy:install]   published commons-lang to /home/xavier/ivy/myrepository/no-namespace/commons-lang/commons-lang/jars/commons-lang-1.0.jar
[ivy:install]   published ivy to /home/xavier/ivy/myrepository/no-namespace/commons-lang/commons-lang/ivys/ivy-1.0.xml
[ivy:install] :: install resolution report ::
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   1   |   1   |   0   |   0   ||   1   |   1   |
        ---------------------------------------------------------------------

BUILD SUCCESSFUL


    这些日志告诉我们使用"libraries"解析器找到了模块定义,而对应的制品从maven2 仓库下载完成。然后都被发布到文件系统仓库(my-repository)。

    让我们看一下我们的仓库:

Z:\>dir /s /B /A:-D myrepository
Z:\myrepository\no-namespace\commons-lang\commons-lang\ivys\ivy-1.0.xml
Z:\myrepository\no-namespace\commons-lang\commons-lang\ivys\ivy-1.0.xml.md5
Z:\myrepository\no-namespace\commons-lang\commons-lang\ivys\ivy-1.0.xml.sha1
Z:\myrepository\no-namespace\commons-lang\commons-lang\jars\commons-lang-1.0.jar
Z:\myrepository\no-namespace\commons-lang\commons-lang\jars\commons-lang-1.0.jar.md5
Z:\myrepository\no-namespace\commons-lang\commons-lang\jars\commons-lang-1.0.jar.sha1


    我们可以看到,现在我们的仓库中有commons-lang模块的版本1.0,调用一个生成的ivy.xml文件,它的jar,和所有md5和sha1检验和,为将来开发人员使用这个仓库来解析模块进行一致性检查而准备。

    3) 安装带有依赖的模块

    现在我们可以说,我们想确认在安装后我们安装的模块的所有的依赖在我们的仓库中都是可用的。我们可以或者在一个staging(临时?分段?)仓库上不带依赖的安装(更多控制),或者使用递推依赖管理并要求ivy为我们安装所有东西(简单很多)。

    调用的target和上面描述的非常相像,除了我们显式的要求递推安装。

    < target  name ="maven2-deps"  depends ="init-ivy"
        description
="--> install module from maven 2 repository with dependencies" >
        
< ivy:install  settingsRef ="basic.settings"
            organisation
="org.hibernate"  module ="hibernate"  revision ="3.2.5.ga"
            from
="${from.resolver}"  to ="${to.resolver}"  transitive ="true"   />
    
</ target >


    如果你调用这个target,你将看到不仅安装hibernate 模块而且也包括它的依赖:

Z:\>ant maven2-deps
Buildfile: build.xml

load-ivy:

init-ivy:

maven2-deps:
[ivy:install] :: loading settings :: url = jar:file://home/xavier/.ivy2/jars/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:install] :: Ivy 2.0.0-beta1-local-20071130005044 - 20071130005044 :: http://ant.apache.org/ivy/ ::
:: loading settings :: file = /home/xavier/ivy/settings/ivysettings-advanced.xml
[ivy:install] :: installing org.hibernate#hibernate;3.2.5.ga ::
[ivy:install] :: resolving dependencies ::
[ivy:install]   found org.hibernate#hibernate;3.2.5.ga in libraries
[ivy:install]   found net.sf.ehcache#ehcache;1.2.3 in libraries
[ivy:install]   found commons-logging#commons-logging;1.0.4 in libraries
[ivy:install]   found commons-collections#commons-collections;2.1 in libraries
[ivy:install]   found javax.transaction#jta;1.0.1B in libraries
[ivy:install]   found asm#asm-attrs;1.5.3 in libraries
[ivy:install]   found dom4j#dom4j;1.6.1 in libraries
[ivy:install]   found antlr#antlr;2.7.6 in libraries
[ivy:install]   found cglib#cglib;2.1_3 in libraries
[ivy:install]   found asm#asm;1.5.3 in libraries
[ivy:install]   found commons-collections#commons-collections;2.1.1 in libraries
[ivy:install]   found ant#ant;1.6.5 in libraries
[ivy:install]   found swarmcache#swarmcache;1.0RC2 in libraries
[ivy:install]   found commons-logging#commons-logging;1.0.2 in libraries
[ivy:install]   found jgroups#jgroups-all;2.2.8 in libraries
[ivy:install]   found jboss#jboss-cache;1.2.2 in libraries
[ivy:install]   found jboss#jboss-system;4.0.2 in libraries
[ivy:install]   found jboss#jboss-common;4.0.2 in libraries
[ivy:install]   found slide#webdavlib;2.0 in libraries
[ivy:install]   found xerces#xercesImpl;2.6.2 in libraries
[ivy:install]   found jboss#jboss-minimal;4.0.2 in libraries
[ivy:install]   found jboss#jboss-j2se;200504122039 in libraries
[ivy:install]   found concurrent#concurrent;1.3.4 in libraries
[ivy:install]   found jgroups#jgroups-all;2.2.7 in libraries
[ivy:install]   found c3p0#c3p0;0.9.1 in libraries
[ivy:install]   found javax.security#jacc;1.0 in libraries
[ivy:install]   found opensymphony#oscache;2.1 in libraries
[ivy:install]   found proxool#proxool;0.8.3 in libraries
[ivy:install] :: downloading artifacts to cache ::
[ivy:install] downloading http://repo1.maven.org/maven2/org/hibernate/hibernate/3.2.5.ga/hibernate-3.2.5.ga.jar ...
[ivy:install]
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install]
... ... ... ... ... ... ... ...   (2202kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] org.hibernate#hibernate;3.2.5.ga/hibernate.jar[jar] (31105ms)
[ivy:install] downloading http://repo1.maven.org/maven2/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install]
... ... ... ... ... ... ... ...   (203kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] net.sf.ehcache#ehcache;1.2.3/ehcache.jar[jar] (3223ms)
[ivy:install] downloading http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
...
[ivy:install] ... ... ... ... ... ... ... ...   (37kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] commons-logging#commons-logging;1.0.4/commons-logging.jar[jar] (1176ms)
[ivy:install] downloading http://repo1.maven.org/maven2/asm/asm-attrs/1.5.3/asm-attrs-1.5.3.jar
...
[ivy:install] ... .. (16kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] asm#asm-attrs;1.5.3/asm-attrs.jar[jar] (872ms)
[ivy:install] downloading http://repo1.maven.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install] .. (306kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] dom4j#dom4j;1.6.1/dom4j.jar[jar] (3895ms)
[ivy:install] downloading http://repo1.maven.org/maven2/antlr/antlr/2.7.6/antlr-2.7.6.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install] ... ... ... ... ... ... ... ...   (433kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] antlr#antlr;2.7.6/antlr.jar[jar] (6909ms)
[ivy:install] downloading http://repo1.maven.org/maven2/cglib/cglib/2.1_3/cglib-2.1_3.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install] ...  (275kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] cglib#cglib;2.1_3/cglib.jar[jar] (4062ms)
[ivy:install] downloading http://repo1.maven.org/maven2/asm/asm/1.5.3/asm-1.5.3.jar
...
[ivy:install] ......  (25kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] asm#asm;1.5.3/asm.jar[jar] (980ms)
[ivy:install] downloading http://repo1.maven.org/maven2/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install]
... ... ... ... ... ... ... ...    (171kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] commons-collections#commons-collections;2.1.1/commons-collections.jar[jar] (3476ms)
[ivy:install] downloading http://repo1.maven.org/maven2/commons-collections/commons-collections/2.1/commons-collections-2.1.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install]
... ... ... ... ... ... ... ...    (161kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] commons-collections#commons-collections;2.1/commons-collections.jar[jar] (3931ms)
[ivy:install] downloading http://repo1.maven.org/maven2/ant/ant/1.6.5/ant-1.6.5.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install]
... ... ... ... ... ... ... ...    (1009kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] ant#ant;1.6.5/ant.jar[jar] (20564ms)
[ivy:install] downloading http://repo1.maven.org/maven2/swarmcache/swarmcache/1.0RC2/swarmcache-1.0RC2.jar
...
[ivy:install] ... ... ... ... ... ... ... ...   (29kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] swarmcache#swarmcache;1.0RC2/swarmcache.jar[jar] (1985ms)
[ivy:install] downloading http://repo1.maven.org/maven2/jboss/jboss-cache/1.2.2/jboss-cache-1.2.2.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install] .. (365kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] jboss#jboss-cache;1.2.2/jboss-cache.jar[jar] (6026ms)
[ivy:install] downloading http://repo1.maven.org/maven2/jgroups/jgroups-all/2.2.8/jgroups-all-2.2.8.jar
...
[ivy:install] ... ... ... ... ... ... ... ...  
[ivy:install]
... ... ... ... ... ... ... ...    (1573kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] jgroups#jgroups-all;2.2.8/jgroups-all.jar[jar] (17176ms)
[ivy:install] downloading http://repo1.maven.org/maven2/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install]
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...   (594kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] c3p0#c3p0;0.9.1/c3p0.jar[jar] (4332ms)
[ivy:install] downloading http://repo1.maven.org/maven2/opensymphony/oscache/2.1/oscache-2.1.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...   (111kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] opensymphony#oscache;2.1/oscache.jar[jar] (1676ms)
[ivy:install] downloading http://repo1.maven.org/maven2/proxool/proxool/0.8.3/proxool-0.8.3.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install]
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...   (464kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] proxool#proxool;0.8.3/proxool.jar[jar] (3476ms)
[ivy:install] downloading http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar
...
[ivy:install] ... ... ... ... ... ... ... ...   (25kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] commons-logging#commons-logging;1.0.2/commons-logging.jar[jar] (794ms)
[ivy:install] downloading http://repo1.maven.org/maven2/jboss/jboss-system/4.0.2/jboss-system-4.0.2.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...   (227kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] jboss#jboss-system;4.0.2/jboss-system.jar[jar] (1937ms)
[ivy:install] downloading http://repo1.maven.org/maven2/jboss/jboss-common/4.0.2/jboss-common-4.0.2.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install]
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...   (457kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] jboss#jboss-common;4.0.2/jboss-common.jar[jar] (3589ms)
[ivy:install] downloading http://repo1.maven.org/maven2/jboss/jboss-minimal/4.0.2/jboss-minimal-4.0.2.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...   (163kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] jboss#jboss-minimal;4.0.2/jboss-minimal.jar[jar] (1838ms)
[ivy:install] downloading http://repo1.maven.org/maven2/jboss/jboss-j2se/200504122039/jboss-j2se-200504122039.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install] ... ... ... ... ... ... ... ...    (350kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] jboss#jboss-j2se;200504122039/jboss-j2se.jar[jar] (2806ms)
[ivy:install] downloading http://repo1.maven.org/maven2/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...   (184kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] concurrent#concurrent;1.3.4/concurrent.jar[jar] (1748ms)
[ivy:install] downloading http://repo1.maven.org/maven2/jgroups/jgroups-all/2.2.7/jgroups-all-2.2.7.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install]
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... (1613kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] jgroups#jgroups-all;2.2.7/jgroups-all.jar[jar] (10938ms)
[ivy:install] downloading http://repo1.maven.org/maven2/slide/webdavlib/2.0/webdavlib-2.0.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... (128kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] slide#webdavlib;2.0/webdavlib.jar[jar] (1526ms)
[ivy:install] downloading http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar
...
[ivy:install] ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
[ivy:install]
... ... ... ... ... ... ... ...   (986kB)
[ivy:install] .. (0kB)
[ivy:install]   [SUCCESSFUL ] xerces#xercesImpl;2.6.2/xercesImpl.jar[jar] (6906ms)
[ivy:install] :: installing in my-repository ::
[ivy:install]   published hibernate to myrepository/no-namespace/org.hibernate/hibernate/jars/hibernate-3.2.5.ga.jar
[ivy:install]   published ivy to myrepository/no-namespace/org.hibernate/hibernate/ivys/ivy-3.2.5.ga.xml
[ivy:install]   published ehcache to myrepository/no-namespace/net.sf.ehcache/ehcache/jars/ehcache-1.2.3.jar
[ivy:install]   published ivy to myrepository/no-namespace/net.sf.ehcache/ehcache/ivys/ivy-1.2.3.xml
[ivy:install] missing artifact javax.transaction#jta;1.0.1B/jta.jar[jar]:
[ivy:install]   cache/no-namespace/javax.transaction/jta/jars/jta-1.0.1B.jar file does not exist
[ivy:install]   published ivy to myrepository/no-namespace/javax.transaction/jta/ivys/ivy-1.0.1B.xml
[ivy:install]   published commons-logging to myrepository/no-namespace/commons-logging/commons-logging/jars/commons-logging-1.0.4.jar
[ivy:install]   published ivy to myrepository/no-namespace/commons-logging/commons-logging/ivys/ivy-1.0.4.xml
[ivy:install]   published asm-attrs to myrepository/no-namespace/asm/asm-attrs/jars/asm-attrs-1.5.3.jar
[ivy:install]   published ivy to myrepository/no-namespace/asm/asm-attrs/ivys/ivy-1.5.3.xml
[ivy:install]   published dom4j to myrepository/no-namespace/dom4j/dom4j/jars/dom4j-1.6.1.jar
[ivy:install]   published ivy to myrepository/no-namespace/dom4j/dom4j/ivys/ivy-1.6.1.xml
[ivy:install]   published antlr to myrepository/no-namespace/antlr/antlr/jars/antlr-2.7.6.jar
[ivy:install]   published ivy to myrepository/no-namespace/antlr/antlr/ivys/ivy-2.7.6.xml
[ivy:install]   published cglib to myrepository/no-namespace/cglib/cglib/jars/cglib-2.1_3.jar
[ivy:install]   published ivy to myrepository/no-namespace/cglib/cglib/ivys/ivy-2.1_3.xml
[ivy:install]   published asm to myrepository/no-namespace/asm/asm/jars/asm-1.5.3.jar
[ivy:install]   published ivy to myrepository/no-namespace/asm/asm/ivys/ivy-1.5.3.xml
[ivy:install]   published commons-collections to myrepository/no-namespace/commons-collections/commons-collections/jars/commons-collections-2.1.1.jar
[ivy:install]   published ivy to myrepository/no-namespace/commons-collections/commons-collections/ivys/ivy-2.1.1.xml
[ivy:install]   published commons-collections to myrepository/no-namespace/commons-collections/commons-collections/jars/commons-collections-2.1.jar
[ivy:install]   published ivy to myrepository/no-namespace/commons-collections/commons-collections/ivys/ivy-2.1.xml
[ivy:install]   published ant to myrepository/no-namespace/ant/ant/jars/ant-1.6.5.jar
[ivy:install]   published ivy to myrepository/no-namespace/ant/ant/ivys/ivy-1.6.5.xml
[ivy:install]   published swarmcache to myrepository/no-namespace/swarmcache/swarmcache/jars/swarmcache-1.0RC2.jar
[ivy:install]   published ivy to myrepository/no-namespace/swarmcache/swarmcache/ivys/ivy-1.0RC2.xml
[ivy:install]   published jboss-cache to myrepository/no-namespace/jboss/jboss-cache/jars/jboss-cache-1.2.2.jar
[ivy:install]   published ivy to myrepository/no-namespace/jboss/jboss-cache/ivys/ivy-1.2.2.xml
[ivy:install]   published jgroups-all to myrepository/no-namespace/jgroups/jgroups-all/jars/jgroups-all-2.2.8.jar
[ivy:install]   published ivy to myrepository/no-namespace/jgroups/jgroups-all/ivys/ivy-2.2.8.xml
[ivy:install]   published c3p0 to myrepository/no-namespace/c3p0/c3p0/jars/c3p0-0.9.1.jar
[ivy:install]   published ivy to myrepository/no-namespace/c3p0/c3p0/ivys/ivy-0.9.1.xml
[ivy:install] missing artifact javax.security#jacc;1.0/jacc.jar[jar]:
[ivy:install]   cache/no-namespace/javax.security/jacc/jars/jacc-1.0.jar file does not exist
[ivy:install]   published ivy to myrepository/no-namespace/javax.security/jacc/ivys/ivy-1.0.xml
[ivy:install]   published oscache to myrepository/no-namespace/opensymphony/oscache/jars/oscache-2.1.jar
[ivy:install]   published ivy to myrepository/no-namespace/opensymphony/oscache/ivys/ivy-2.1.xml
[ivy:install]   published proxool to myrepository/no-namespace/proxool/proxool/jars/proxool-0.8.3.jar
[ivy:install]   published ivy to myrepository/no-namespace/proxool/proxool/ivys/ivy-0.8.3.xml
[ivy:install]   published commons-logging to myrepository/no-namespace/commons-logging/commons-logging/jars/commons-logging-1.0.2.jar
[ivy:install]   published ivy to myrepository/no-namespace/commons-logging/commons-logging/ivys/ivy-1.0.2.xml
[ivy:install]   published jboss-system to myrepository/no-namespace/jboss/jboss-system/jars/jboss-system-4.0.2.jar
[ivy:install]   published ivy to myrepository/no-namespace/jboss/jboss-system/ivys/ivy-4.0.2.xml
[ivy:install]   published jboss-common to myrepository/no-namespace/jboss/jboss-common/jars/jboss-common-4.0.2.jar
[ivy:install]   published ivy to myrepository/no-namespace/jboss/jboss-common/ivys/ivy-4.0.2.xml
[ivy:install]   published jboss-minimal to myrepository/no-namespace/jboss/jboss-minimal/jars/jboss-minimal-4.0.2.jar
[ivy:install]   published ivy to myrepository/no-namespace/jboss/jboss-minimal/ivys/ivy-4.0.2.xml
[ivy:install]   published jboss-j2se to myrepository/no-namespace/jboss/jboss-j2se/jars/jboss-j2se-200504122039.jar
[ivy:install]   published ivy to myrepository/no-namespace/jboss/jboss-j2se/ivys/ivy-200504122039.xml
[ivy:install]   published concurrent to myrepository/no-namespace/concurrent/concurrent/jars/concurrent-1.3.4.jar
[ivy:install]   published ivy to myrepository/no-namespace/concurrent/concurrent/ivys/ivy-1.3.4.xml
[ivy:install]   published jgroups-all to myrepository/no-namespace/jgroups/jgroups-all/jars/jgroups-all-2.2.7.jar
[ivy:install]   published ivy to myrepository/no-namespace/jgroups/jgroups-all/ivys/ivy-2.2.7.xml
[ivy:install]   published webdavlib to myrepository/no-namespace/slide/webdavlib/jars/webdavlib-2.0.jar
[ivy:install]   published ivy to myrepository/no-namespace/slide/webdavlib/ivys/ivy-2.0.xml
[ivy:install]   published xercesImpl to myrepository/no-namespace/xerces/xercesImpl/jars/xercesImpl-2.6.2.jar
[ivy:install]   published ivy to myrepository/no-namespace/xerces/xercesImpl/ivys/ivy-2.6.2.xml
[ivy:install] :: install resolution report ::
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   28  |   28  |   0   |   0   ||   28  |   26  |
        ---------------------------------------------------------------------

BUILD FAILED
build.xml:80: Problem happened while installing modules - see output for details

Total time: 2 minutes 49 seconds


    如你所见,安装失败了。如果你查看日志,你将看到在源仓库中缺少制品。这意味着你需要手工下载那些制品,然后复制他们到你的目标仓库来完成安装。幸运的是在安装过程中ivy使用最努力的算法,因此除了缺少的制品外所有的东西都安装好了。

    你可以也注意到ivy已经安装了两个不同修订版本的commons-logging (1.0.2, 1.0.4).这归结于我们在ivysettings文件中使用了"no conflict"冲突管理器。

    我们不想驱逐任何模块,因为我们正在构建我们自己的仓库。实际上如果我们同时获取commons-logging 1.0.2 和 1.0.4,那是因为在hibernate的递推依赖中有些模块依赖1.0.2而其他的依赖1.0.4。如果我们只获取1.0.4,依赖于1.0.2的模块将在你自己的昂哭中变得不一致(依赖一个你没有安装的版本)。因此直接使用这个模块的开发人员将遇到问题。

    如果你现在更紧密的观察你的仓库,你将可能发现它不是一个准确的源仓库的复制品。让我们看一下一个模块的内容:

Z:\>dir /s /B /A:-D myrepository\no-namespace\org.hibernate\hibernate\
Z:\myrepository\no-namespace\org.hibernate\hibernate\ivys\ivy-3.2.5.ga.xml
Z:\myrepository\no-namespace\org.hibernate\hibernate\ivys\ivy-3.2.5.ga.xml.md5
Z:\myrepository\no-namespace\org.hibernate\hibernate\ivys\ivy-3.2.5.ga.xml.sha1
Z:\myrepository\no-namespace\org.hibernate\hibernate\jars\hibernate-3.2.5.ga.jar
Z:\myrepository\no-namespace\org.hibernate\hibernate\jars\hibernate-3.2.5.ga.jar.md5
Z:\myrepository\no-namespace\org.hibernate\hibernate\jars\hibernate-3.2.5.ga.jar.sha1


    如你所见,这里没有pom(pom是maven2使用的模块metadata格式,在maven2仓库中可用)。作为替换你可以看到ivy文件,实际上是原始hibernate pom转化为ivy文件的。因此现在你有一个带有ivy文件的真实的ivy仓库,这里你可以使用ivy的完整能力,如果你想调整模块metadata(模块配置,细粒度的排除和递推控制,每个模块的冲突管理,...)。

    好,对于这个简单仓库的安装就到这里了,下一个教程将展示如何处理更加复杂的情况,你的源和目的地仓库不遵循同样的命名转换。

分享到:
评论

相关推荐

    apache-ivy-2.5.0-all软件包下载(含bin部署包、src源码和deps依赖包).txt

    该软件包中包含apache-ivy-2.5.0-rc1-bin.tar.gz部署安装包、apache-ivy-2.5.0-rc1-bin-with-deps.zip依赖包、apache-ivy-2.5.0-rc1-src.zip源码。

    ivy-2.4.0-API文档-中文版.zip

    赠送jar包:ivy-2.4.0.jar; 赠送原API文档:ivy-2.4.0-javadoc.jar; 赠送源代码:ivy-2.4.0-sources.jar; 赠送Maven依赖信息文件:ivy-2.4.0.pom; 包含翻译后的API文档:ivy-2.4.0-javadoc-API文档-中文(简体)版...

    apache-ivy-2.3.0-bin.tar.gz

    Apache Ivy 是一个强大的依赖管理工具,常用于Java项目中,以解决复杂的库依赖关系。它是一个轻量级的解决方案,可以集成到构建工具如Ant或Maven中,帮助自动化构建过程。Ivy不仅可以处理JAR文件,还可以管理各种...

    ivy-2.4.0-API文档-中英对照版.zip

    赠送jar包:ivy-2.4.0.jar; 赠送原API文档:ivy-2.4.0-javadoc.jar; 赠送源代码:ivy-2.4.0-sources.jar; 赠送Maven依赖信息文件:ivy-2.4.0.pom; 包含翻译后的API文档:ivy-2.4.0-javadoc-API文档-中文(简体)-...

    apache-ivy-2.3.0-bin.zip

    2. **docs**:这里会有Ivy的用户指南、API文档以及其他相关的说明文件。 3. **lib**:包含Ivy运行时所需的库文件。 4. **src**:如果包含源码,这个目录下会有Ivy的所有源代码文件,按照模块结构划分。 5. **conf**...

    apache-ivy-2-5-0.rar

    在"apache-ivy-2-5-0.rar"这个压缩包中,包含了Apache Ivy 2.5.0版本的所有组件和文档。 Ivy的核心概念是依赖解析,它允许开发者声明项目所依赖的库,并自动下载这些库及其依赖,避免了手动管理JAR文件的繁琐工作。...

    PyPI 官网下载 | ivy-demo-utils-1.1.2.tar.gz

    PyPI(Python Package Index)是Python开发者广泛使用的软件包仓库,它为全球的Python社区提供了一个集中的平台,用于分享、发布和下载Python库。在这个环境中,我们发现了名为"Ivy-Demo-Utils"的Python库,其版本号...

    Python库 | ms_ivy-1.8.4-py2-none-manylinux1_x86_64.whl

    **Python库ms_ivy-1.8.4-py2-none-manylinux1_x86_64.whl详解** 在Python编程中,库扮演着至关重要的角色,它们提供了丰富的功能和模块,帮助开发者高效地完成各种任务。`ms_ivy`是一个这样的库,它的版本为1.8.4,...

    apache-ivy-2.4.0-rc1-bin.zip_ivy

    在Ivy的配置中,开发者可以设置多个 resolver,这些resolver可以指向不同的库仓库,例如公司的内部仓库、Maven仓库或是Ivy自身的本地仓库。这样,当Ant执行构建任务时,Ivy会根据配置自动下载并解决所有必要的依赖,...

    apache-ivy-2.0.0-beta1-src.zip

    2. **构建脚本**:通常会有一个 `build.xml` 文件,这是Ant的构建脚本,用于编译、测试和打包Ivy项目。通过分析这个文件,我们可以了解如何使用Ant构建Ivy这样的项目。 3. **文档**:虽然这里可能没有完整的用户...

    apache-ivy-2.3.0-rc2-bin.zip

    Ivy会根据这些信息,从指定的仓库(如Maven中央仓库或公司内部仓库)下载所需的依赖。 在"apache-ivy-2.3.0-rc2-bin.zip"这个压缩包中,你可以期待找到以下内容: 1. **ivy.jar**:这是Apache Ivy的主要运行时库,...

    rh-maven33-apache-ivy-2.3.0-4.17.el7.noarch.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    PyPI 官网下载 | ms_ivy-1.8.4-py2-none-manylinux1_x86_64.whl

    资源来自pypi官网。 资源全名:ms_ivy-1.8.4-py2-none-manylinux1_x86_64.whl

    Python库 | ivy-demo-utils-1.1.1.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:ivy-demo-utils-1.1.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    apache-ivy

    2. **解析依赖**:Ivy能够根据配置文件查找并下载项目依赖的所有库,包括间接依赖。 3. **版本控制**:Ivy支持多种版本控制策略,如“latest.release”(获取最新发布的版本)或“latest.integration”(获取最新...

    Python库 | ms_ivy-1.8.17-py2-none-manylinux1_x86_64.whl

    资源分类:Python库 所属语言:Python 资源全名:ms_ivy-1.8.17-py2-none-manylinux1_x86_64.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    apache-ivy-2.3.0.rar

    2. **仓库支持**:Ivy可以连接到多种类型的仓库,如Maven中央仓库、 Ivy自身的仓库、公司内部的Nexus或Artifactory等,检索项目所需的依赖。 3. **解析依赖**:Ivy会自动解析和解决项目中所有直接和间接依赖的关系...

    rh-java-common-ivy-local-support-4.3.2-1.14.el7.noarch.rpm

    官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装

    Python库 | ivy-phylo-20120228.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:ivy-phylo-20120228.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

Global site tag (gtag.js) - Google Analytics