ivy教程(6)-项目依赖
2009-10-08 00:00:00 来源:WEB开发网这里我们可以看到:
* 项目依赖1个类型(1个制品)
* 这个类库不再ivy缓存中并且因此被下载 (1 downloaded)
* 这个项目被发行,版本号为1
给了给出关于publish的更多的解析,如你所见publish任务的调用导致了两个主要事情:
* 交付被解析的ivy文件到build/ivy.xml
这个被完成时因为默认publish任务不仅仅发行制品们而且也发行ivy文件。因此它查看ivy文件应该被发行到的路径,使用artifactspattern: ${build.dir}/[artifact].[ext].
对于一个ivy文件,这将解析到build/ivy.xml。因为这个文件不存在,它自动调用deliver任务交付一个被解析的ivy文件到这个目的地。
* 制品dependee的发行和ivy文件到仓库
都仅仅是在当前项目中找到的文件拷贝,更明确的在build目录中。这是因为artifactspattern 被设置为${build.dir}/[artifact].[ext],因此dependee 制品分布在build/dependee.jar而ivy文件在build/ivy.xml. 并且因为我们要求publish任务使用"projects"解析器发行他们,这些文件被复制到repository\dependee-1.jar 和 repository\dependee-1.xml,遵守我们设置中的artifact和ivy模式。
step 4: 运行depender
进入depender目录并运行ant
I:\depender>ant
Buildfile: src\example\dependence\depending\build.xml
clean:
resolve:
[ivy:retrieve] :: Ivy 2.0.0-beta1-local-20071104204849 - 20071104204849 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: file = C:\dev\data\opensource_workspace\ivy\src\example\dependence\config\ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: [ org.apache | depending | working@BEN-ScokartG ]
[ivy:retrieve] confs: [default]
[ivy:retrieve] found [ org.apache | standalone | 1 ] in projects
[ivy:retrieve] [1] [ org.apache | standalone | latest.integration ]
[ivy:retrieve] found [ commons-lang | commons-lang | 2.0 ] in libraries
[ivy:retrieve] downloading C:\dev\data\opensource_workspace\ivy\src\example\dependence\config\repository\standalone-1.jar ...
[ivy:retrieve] .. (1kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve] [SUCCESSFUL ] [ org.apache | standalone | 1 ]/standalone.jar[jar] (20ms)
[ivy:retrieve] :: resolution report ::
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 2 | 1 | 0 | 0 || 2 | 1 |
---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: [ org.apache | depending ]
[ivy:retrieve] confs: [default]
[ivy:retrieve] 2 artifacts copied, 0 already retrieved
compile:
[mkdir] Created dir: C:\dev\data\opensource_workspace\ivy\src\example\dependence\depending\build\classes
[javac] Compiling 1 source file to C:\dev\data\opensource_workspace\ivy\src\example\dependence\depending\build\classes
run:
[java] you are using version 1 of class standalone.Main
[java] standard message : i am depending.Main and standalone.Main will do the job for me
[java] [standalone.Main] capitalizing string "i am depending.Main and standalone.Main will do the job for me" using org.apache.commons.lang.WordUtils
[java] capitalized message : I Am Depending.main And Standalone.main Will Do The Job For Me
BUILD SUCCESSFUL
Total time: 3 seconds
更多精彩
赞助商链接