配置用于创建依赖项的逻辑分组:
<ivy-module version="2.0">
<info organisation="com.myspotontheweb" module="demo"/>
<configurations>
<conf name="frontEnd" description="Jars used by front end"/>
<conf name="businessLogic" description="Jars used for business logic"/>
</configurations>
<dependencies>
<dependency org="commons-lang" name="commons-lang" rev="2.5" conf="businessLogic->default"/>
<dependency org="commons-codec" name="commons-codec" rev="1.4" conf="businessLogic->default"/>
<dependency org="commons-cli" name="commons-cli" rev="1.2" conf="frontEnd->default"/>
<dependency org="commons-logging" name="commons-logging" rev="1.1.1" conf="frontEnd->default"/>
</dependencies>
</ivy-module>
常春藤
检索
编译文件
<target name="init" description="--> retrieve dependencies with ivy">
<ivy:retrieve conf="businessLogic" pattern="lib/[artifact].[ext]"/>
<ivy:retrieve conf="frontEnd" pattern="web/webroot/WEB-INF/lib/[artifact].[ext]"/>
</target>
$ find . -type f
./build.xml
./ivy.xml
./lib/commons-lang.jar
./lib/commons-codec.jar
./web/webroot/WEB-INF/lib/commons-cli.jar
./web/webroot/WEB-INF/lib/commons-logging.jar