Sky's blog

          我和我追逐的夢(mèng)

          常用鏈接

          統(tǒng)計(jì)

          其他鏈接

          友情鏈接

          最新評(píng)論

          ivy中文參考文檔(12)-單獨(dú)使用

              1) 單獨(dú)使用

              ivy可以非常容易的作為一個(gè)單獨(dú)的程序使用。你所需要的只是一個(gè)java1.4+的運(yùn)行環(huán)境(JRE)!

              這是如何調(diào)用它的例子:

          java -jar ivy.jar -?

              它將實(shí)現(xiàn)類(lèi)似這樣的在線幫助:

          ==== settings options
           -settings 
          <settingsfile>     use given file for settings
           -cache 
          <cachedir>            use given directory for cache
           -novalidate                  do not validate ivy files against xsd
           -m2compatible                use maven2 compatibility

          ==== resolve options
           -ivy 
          <ivyfile>               use given file as ivy file
           -dependency 
          <organisation> <module> <revision>
                                        use this instead of ivy file to do the rest of the
                                         work with this as a dependency.
           -confs 
          <configurations>      resolve given configurations

          ==== retrieve options
           -retrieve 
          <retrievepattern>  use given pattern as retrieve pattern
           -sync                        use sync mode for retrieve

          ==== cache path options
           -cachepath 
          <cachepathfile>   outputs a classpath consisting of all dependencies
                                         in cache (including transitive ones) of the given
                                         ivy file to the given cachepathfile

          ==== deliver options
           -deliverto 
          <ivypattern>      use given pattern as resolved ivy file pattern

          ==== publish options
           -publish 
          <resolvername>      use given resolver to publish to
           -publishpattern 
          <artpattern> use given pattern to find artifacts to publish
           -revision 
          <revision>         use given revision to publish the module
           -status 
          <status>             use given status to publish the module

          ==== http auth options
           -realm 
          <realm>               use given realm for HTTP AUTH
           -host 
          <host>                 use given host for HTTP AUTH
           -username 
          <username>         use given username for HTTP AUTH
           -passwd 
          <passwd>             use given password for HTTP AUTH

          ==== launcher options
           -main 
          <main>                 the FQCN of the main class to launch
           -args 
          <args>                 the arguments to give to the launched process
           -cp 
          <cp>                     extra classpath to use 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版本后系統(tǒng)屬性被包含在ivy變量中,因此你可以很容易的定義ivy變量,類(lèi)似這樣:

              2) 例子

              java -jar ivy.jar

               用默認(rèn)配置和當(dāng)前目錄里面的ivy.xml調(diào)用ivy

          java -jar ivy.jar -settings path/to/myivysettings.xml -ivy path/to/myivy.xml

              用給定的ivysettings文件和給定的ivy文件調(diào)用ivy

              1. 從1.3版本開(kāi)始

          java -jar ivy.jar -settings path/to/myivysettings.xml -dependency apache commons-lang 2.0

              用給定的ivysettings文件調(diào)用ivy并解析依賴(lài)apache commons-lang 2.0.

              這等同于:

          java -jar ivy.jar -settings path/to/myivysettings.xml -ivy ivy.xml
             
              而ivy.xml內(nèi)容如下:

          <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>

              2. 從1.3版本開(kāi)始

          java -jar ivy.jar -settings path/to/myivysettings.xml -ivy path/to/myivy.xml -cachepath mycachefile.txt

              用給定的ivysettings文件調(diào)用ivy并解析在給定的ivy文件中發(fā)現(xiàn)的依賴(lài),然后輸出被解析的在緩存中的制品的classpath到文件中。這個(gè)文件隨后可以被用來(lái)為任何java程序定義符合所有被解析的依賴(lài)的classpath。

              3. 從 1.4開(kāi)始

          java -jar ivy.jar -settings path/to/myivysettings.xml -dependency bar foo 2.0 -main org.bar.foo.FooMain

          用給定的ivysettings文件調(diào)用ivy并解析依賴(lài)bar foo 2.0,然后用解析出來(lái)的制品運(yùn)行類(lèi)org.foo.FooMain。

          posted on 2009-07-23 13:36 sky ao 閱讀(1608) 評(píng)論(1)  編輯  收藏 所屬分類(lèi): project building

          評(píng)論

          # re: ivy中文參考文檔(12)-單獨(dú)使用 2009-07-23 16:15 施華洛世奇

          哦  回復(fù)  更多評(píng)論   

          主站蜘蛛池模板: 绍兴市| 麦盖提县| 平湖市| 张家港市| 景东| 微博| 云安县| 利川市| 黑山县| 渝北区| 定兴县| 遵义市| 铅山县| 新密市| 巧家县| 绥滨县| 丹东市| 新绛县| 安国市| 舟曲县| 庄河市| 安吉县| 奉新县| 兰坪| 武威市| 巴马| 子洲县| 楚雄市| 江门市| 泰和县| 永新县| 聊城市| 弥勒县| 香港 | 湘潭市| 崇文区| 漾濞| 虞城县| 南宫市| 新丰县| 五莲县|