ivy和maven使用概述

 

一:需求

将一个老的标准web工程,在不改变目录结构的前提下添加依赖管理。并且做到对开发人员透明,不增加开发人员在开发过程中的配置和学习成本。

二:现状

通过了解,兄弟产品对标准web工程添加“依赖管理”后,通过手动、批处理、ant等方式执行拷贝jar包命令,将jar包拷贝到工程的lib目录中。

mvn copy-dependencies-DoutputDirectory=${lib.dir}"

 

三:概念

1、什么是apache ivy

Ivy is a toolfor managing (recording, tracking, resolving and reporting) projectdependencies. It is characterized by the following:

flexibility andconfigurability - Ivy is essentially process agnostic and is not tied to anymethodology or structure. Instead it provides the necessary flexibility andconfigurability to be adapted to a broad range of dependency management andbuild processes.

tightintegration with Apache Ant - while available as a standalone tool, Ivy worksparticularly well with Apache Ant providing a number of powerful Ant tasksranging from dependency resolution to dependency reporting and publication.

Ivy is opensource and released under a very permissive Apache License.

 

Ivy has a lot ofpowerful Features, the most popular and useful being its flexibility,integration with ant, and its strong transitive dependencies management engine.

 

The transitivedependencies management is a feature which lets you get dependencies of yourdependencies, transitively. In order to address this general problem, ivy needsto find metadata about your modules, usually in an ivy file. To find themetadata and your dependencies' artifacts (usually jars), Ivy can be configuredto use a lot of different repositories.

 

2apache ivyapache maven对比?

First, the mostimportant difference is that they aren't at all the same kind of tools. ApacheMaven is a software project management and comprehension tool, whereas ApacheIvy is only a dependency management tool, highly integrated with Apache Ant™,the popular build management tool. So maybe a more interesting comparison wouldcompare Apache Ant+Ivy vs Apache Maven. But this goes beyond the scope of thispage which concentrates on dependency management only.

 

以上内容来自apacheivy官方网站http://ant.apache.org/ivy/

 

四、实践

1apache ivyeclipse中使用

ivyde插件:

http://www.apache.org/dist/ant/ivyde/updatesite

通过ivyde添加“依赖管理”后的目录结构:


 

Ivyde插件在修改依赖关系时自动更新工程lib目录中jar


2maven2eclipse中使用

m2eclipse插件:

http://m2eclipse.sonatype.org/sites/m2e

通过m2eclipse添加“依赖管理”后的目录结构:


目前的配置中,只能通过deploy的方式启动工程。m2eclipse插件无法将jar包拷贝原工程的lib目录下,只能拷贝到deploy后的工程的lib目录下。

原工程目录:


Deploy后的工程目录:


 

五:总结:

apache ivy是一个敏捷的依赖依赖管理工具,可以和ant集成起来使用。apache ivy默认使用maven2repository ,并且可以直接使用maven2pom.xml配置文件。所以在使用同一个pom.xml文件时,可以做到apache ivymaven2无缝转换。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胡矣

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值