Ivy 可以非常容易地作為獨立程式使用,只需要 Java 1.4+ 執行環境 (JRE)!
執行 java -jar ivy.jar -? 可獲得線上說明:
==== settings options
-settings use given file for settings
-cache use given directory for cache
-novalidate do not validate ivy files against xsd
-m2compatible use maven2 compatibility
==== resolve options
-ivy use given file as ivy file
-dependency use this instead of ivy file
-confs resolve given configurations
==== retrieve options
-retrieve use given pattern as retrieve pattern
-sync use sync mode for retrieve
==== cache path options
-cachepath outputs classpath of all dependencies in cache
==== deliver options
-deliverto use given pattern as resolved ivy file pattern
==== publish options
-publish use given resolver to publish to
-publishpattern use given pattern to find artifacts to publish
-revision use given revision to publish the module
-status use given status to publish the module
==== http auth options
-realm use given realm for HTTP AUTH
-host use given host for HTTP AUTH
-username use given username for HTTP AUTH
-passwd use given password for HTTP AUTH
==== launcher options
-main the FQCN of the main class to launch
-args arguments to give to the launched process
-cp extra classpath when launching process
==== message options
-debug set message level to debug
-verbose set message level to verbose
-warn set message level to warn
-error set message level to error
==== help options
-? display this help
-deprecated show deprecated options
從 1.3 版起系統屬性被包含在 Ivy 變數中,可輕鬆定義 Ivy 變數。
java -jar ivy.jar
用預設配置和當前目錄的 ivy.xml 調用 Ivy
java -jar ivy.jar -settings path/to/myivysettings.xml -ivy path/to/myivy.xml
用給定的 ivysettings 和 ivy 檔案調用 Ivy
java -jar ivy.jar -settings path/to/myivysettings.xml -dependency apache commons-lang 2.0
等同於使用以下 ivy.xml:
<ivy-module version="1.0">
<info organisation="org" module="standalone" revision="working"/>
<dependencies>
<dependency org="apache" name="commons-lang" rev="2.0" conf="default->*"/>
</dependencies>
</ivy-module>
java -jar ivy.jar -settings path/to/myivysettings.xml -ivy path/to/myivy.xml -cachepath mycachefile.txt
解析依賴並輸出快取中制品的 classpath 到檔案,可用於任何 Java 程式。
java -jar ivy.jar -settings path/to/myivysettings.xml -dependency bar foo 2.0 -main org.bar.foo.FooMain
解析依賴後用解析出的制品執行指定主類別。