ivy java_Ant+Ivy for building java projects

本文介绍了如何在Ant中下载和配置Apache Ant和Ivy,以及如何将Ivy用于解决项目依赖。通过创建build.xml和ivy.xml文件,实现AJ文件的编译和依赖管理。最后,展示了如何将AspectJAdvice织入到apsensor.jar中,供其他Java文件使用。
摘要由CSDN通过智能技术生成

Install Ant: download the ant package

tar zvxf apache-ant-1.9.4-bin.tar.gz

#in .bashrc file#Ant

export ANT_HOME=/home/chase/runnable/apache-ant-1.9.4export CLASSPATH=${ANT_HOME}/lib:${CLASSPATH}:.

export PATH=${ANT_HOME}/bin:${PATH}

Install Ivy: download the latest Ivy package "apache-ivy-2.4.0-rc1-bin.tar.gz" and unpack

tar zvxf apache-ivy-2.4.0-rc1-bin.tar.gz

it shows:

6155e6d5ff4d297e564584034522ab36.png

and then copy the jar to the ant/lib classpath:

chase@pc0:~/runnable/apache-ivy-2.4.0-rc1$ cp ivy-2.4.0-rc1.jar ../apache-ant-1.9.4/lib/

then Ant and Ivy is combined!!!!!!!!!!!

How to use Ant and Ivy together

for ant create a build.xml, for Ivy create an ivy.xml file. That is

4774fe3cac16ea1700ff6674fa6a67eb.png

this project is for building an xx.aj file. ant is for building and ivy is for reslove dependencies:

the build file is

AP01 Tracer-simple tracer

Targets

clean: Removes all bytecode.

build-all: Build and create JAR

Author: Klaus Marius Hansen

The ivy.xml is

The src folder is the .aj file: src/dk/diku/tracer/Tracer.aj

The test folder is empty. After run

$ant clean build-all

is becomes:

27476a67533b95adad82b51776631414.png

in the build folder :

268548407a16299ce72ddbb8304d3fdb.png

in the lib folder:

1f2931f42ec362bc3f6a3a6fb5802cfb.png

Then the aspectj advices are weaved into the apsensor.jar file which can be used in other java files.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值