2.2. Apache Ivy

简介:

2.2.1. Ivy Install

2.2.1.1. source code

cd /usr/local/src
wget http://labs.renren.com/apache-mirror//ant/ivy/2.2.0/apache-ivy-2.2.0-bin.tar.gz
tar zxvf apache-ivy-2.2.0-bin.tar.gz
mv apache-ivy-2.2.0 /usr/local/
cd ..
ln -s apache-ivy-2.2.0 apache-ivy
			
IVY_HOME=/usr/local/apache-ivy
			
cp $IVY_HOME/ivy-2.2.0.jar $ANT_HOME/lib/
			

2.2.1.2. apt-get

$ sudo apt-get install ant
$ sudo apt-get install ivy
			

To know more about this package, you can use dpkg

$ dpkg -s ivy
			

2.2.2. Test example

ant

cd $IVY_HOME/src/example/hello-ivy
ant

Buildfile: /usr/local/apache-ivy-2.2.0/src/example/hello-ivy/build.xml

resolve:
[ivy:retrieve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: url = jar:file:/usr/local/apache-ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: org.apache#hello-ivy;working@example.com
[ivy:retrieve]  confs: [default]
[ivy:retrieve]  found commons-lang#commons-lang;2.0 in public
[ivy:retrieve]  found commons-cli#commons-cli;1.0 in public
[ivy:retrieve]  found commons-logging#commons-logging;1.0 in public
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/2.0/commons-lang-2.0.jar ...
[ivy:retrieve] .......................................................................................
[ivy:retrieve] ..................................................................................................................................................................
[ivy:retrieve] ........................................................................................... (165kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-lang#commons-lang;2.0!commons-lang.jar (4790ms)
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/2.0/commons-lang-2.0-javadoc.jar ...
[ivy:retrieve] ................................................................................................................
[ivy:retrieve] .........................................
[ivy:retrieve] ..................................................
[ivy:retrieve] .....................................................
[ivy:retrieve] ..................................................................................................................................
[ivy:retrieve] ..................................................................................................................................
[ivy:retrieve] .................................................................................................................
[ivy:retrieve] ...........................................................................................................................................................................
[ivy:retrieve] .............................................................................................................................................................................................. (467kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-lang#commons-lang;2.0!commons-lang.jar(javadoc) (14878ms)
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-lang/commons-lang/2.0/commons-lang-2.0-sources.jar ...
[ivy:retrieve] ...........................................................................................................................................................................
[ivy:retrieve] ................................................................................................................................................................................................................
[ivy:retrieve] .............................................................................................................................................. (245kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-lang#commons-lang;2.0!commons-lang.jar(source) (5046ms)
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0-javadoc.jar ...
[ivy:retrieve] ....................................................................................................................................................
[ivy:retrieve] ...................................... (92kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-cli#commons-cli;1.0!commons-cli.jar(javadoc) (2838ms)
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0.jar ...
[ivy:retrieve] ......................................................... (29kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-cli#commons-cli;1.0!commons-cli.jar (5147ms)
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0-sources.jar ...
[ivy:retrieve] ...................................................................................................... (48kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-cli#commons-cli;1.0!commons-cli.jar(source) (2163ms)
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0/commons-logging-1.0.jar ...
[ivy:retrieve] ............................................ (21kB)
[ivy:retrieve] ... (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-logging#commons-logging;1.0!commons-logging.jar (2638ms)
[ivy:retrieve] :: resolution report :: resolve 30806ms :: artifacts dl 37511ms
[ivy:retrieve]  :: evicted modules:
[ivy:retrieve]  commons-lang#commons-lang;1.0 by [commons-lang#commons-lang;2.0] in [default]
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   4   |   3   |   3   |   1   ||   7   |   7   |
        ---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: org.apache#hello-ivy
[ivy:retrieve]  confs: [default]
[ivy:retrieve]  7 artifacts copied, 0 already retrieved (1069kB/11ms)

run:
    [mkdir] Created dir: /usr/local/apache-ivy-2.2.0/src/example/hello-ivy/build
    [javac] /usr/local/apache-ivy-2.2.0/src/example/hello-ivy/build.xml:53: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to /usr/local/apache-ivy-2.2.0/src/example/hello-ivy/build
     [java] standard message : hello ivy !
     [java] capitalized by org.apache.commons.lang.WordUtils : Hello Ivy !

BUILD SUCCESSFUL
Total time: 1 second

		

run it

neo@debian:/usr/local/apache-ivy/src/example/hello-ivy/build$ export CLASSPATH=$CLASSPATH:/usr/local/apache-ivy/src/example/hello-ivy/lib/*
neo@debian:/usr/local/apache-ivy/src/example/hello-ivy/build$ /usr/local/java/bin/java example.Hello
standard message : hello ivy !
capitalized by org.apache.commons.lang.WordUtils : Hello Ivy !
		




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
Java Maven Android开发
eclipse 中 maven的pom.xml文件发生错误:CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven...
eclipse 中 maven的pom.xml文件发生错误:CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven...
512 0
eclipse 中 maven的pom.xml文件发生错误:CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven...
|
5月前
|
Java Maven
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4
|
2月前
|
存储 Java 测试技术
玩转Apache Maven
玩转Apache Maven
53 0
|
6月前
【apache-maven-3.5.4\conf\setting文件配置】
【apache-maven-3.5.4\conf\setting文件配置】
|
8月前
|
Java Maven Android开发
成功解决maven打war包报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2
成功解决maven打war包报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2
|
11月前
|
Java Maven Android开发
Maven-Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1
Maven-Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:1.1
66 0
|
Java Maven
org.apache.maven.plugins:maven-resources-plugin:2.4.3
在myeclipse上创建maven可能会遇到 org.apache.maven.plugins:maven-resources-plugin:2.4.3 org.apache.maven.plugins:maven-jar-plugin:2.3.1 org.apache.maven.maven-surefire-plugin:2.7.1 等错误那么这是什么原因呢?
123 0
org.apache.maven.plugins:maven-resources-plugin:2.4.3
|
Java Maven Windows
解决 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
解决 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
1997 0
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test
|
Java Maven
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apach
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apach
99 0