using ant ivy in netbeans

本秂侑毒 提交于 2019-12-23 04:05:31

问题


Since I am new to Ant+Ivy this might sound very naive question but please bear with me. I recently installed Ivy plugin to work with netbeans. But I don't know what to do next? Do I have to create ivy.xml file myself ? do I have to add its reference to nbbuild.xml somewhere? if yes where?

and finally how to write ivy.xml to fetch latest versions of the libraries I am using. e.g. I am using jgraph.jar, commons-codec-1.6.jar etc, Can somebody demonstrate how to write code in ivy.xml file to fetch the latest versions of these? These are available in the maven central repository, Can I connect to that thru ivy.xml? If yes how?


回答1:


The following answer to your other question gives a detailed example of a working ivy enabled project:

  • Use Ant in netbeans to dynamically fetch latest versions of external libraries during build

Yes, you'll have to create the ivy.xml file yourself, but Maven Central makes this really easy. Your examples are as follows:

  • jgraph
  • commons-codec-1.6

Just copy-n-paste the ivy dependency declarations into your ivy.xml file:

<dependencies>
  <dependency org="jgraph" name="jgraph" rev="5.13.0.0" />
  <dependency org="commons-codec" name="commons-codec" rev="1.6" />
</dependencies>

Update

If you want to latest revision of a dependency then use the dynamic revisions feature.

<dependencies>
  <dependency org="jgraph" name="jgraph" rev="latest.release" />
  <dependency org="commons-codec" name="commons-codec" rev="latest.release" />
</dependencies>

Be warned this can lead to build instability as 3rd party projects will change over time.



来源:https://stackoverflow.com/questions/17158456/using-ant-ivy-in-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!