如何使用常春藤api以编程方式为缓存中的模块构建路径?

时间:2015-06-24 15:12:22

标签: java dependencies ivy

我想按照ivy official documentation编程方式(即不使用ant或命令行工具)执行来自缓存的构建路径

enter image description here

不幸的是,没有指向ivy API中相应类的指针可以帮助实现这一目标。

是否有可以向我学习的代码示例?

1 个答案:

答案 0 :(得分:1)

一个起点是从常春藤本身的Main.java读取,并在Ivy的代码中查看 cachepath 操作performed

要查看输出样本,请运行

java -jar ivy-2.4.0.jar -dependency commons-logging commons-logging 1.1 -cachepath file.txt

文件file.txt成立:

/home/cran/.ivy2/cache/commons-logging/commons-logging/sources/commons-logging-1.1-sources.jar:/home/cran/.ivy2/cache/commons-logging/commons-logging/j
ars/commons-logging-1.1.jar:/home/cran/.ivy2/cache/log4j/log4j/jars/log4j-1.2.12.jar:/home/cran/.ivy2/cache/logkit/logkit/jars/logkit-1.0.1.jar:/home/c
ran/.ivy2/cache/avalon-framework/avalon-framework/jars/avalon-framework-4.1.3.jar:/home/cran/.ivy2/cache/javax.servlet/servlet-api/jars/servlet-api-2.3
.jar