IVY Build, how do I use an extlib directory in the project?

一世执手 提交于 2019-12-02 07:01:21

问题


There are several jar files, which are from a COTS product that we keep in our project's "extlib" folder at the root of the project. I want to have these included in ivy, but not put in the repository, just read from the project/extlib folder. Is this possible or do I need to add them to the artifactory?


回答1:


Create an ivy settings file with the following content:

<ivysettings>
  <settings defaultResolver='artifactory' />
  <resolvers>
    <ibiblio name='artifactory' m2compatible='true' root="http://my.artifactory.server"/>
    <filesystem name='local'>
      <artifact pattern='${ivy.settings.dir}/extlib/[artifact]' />
    </filesystem>
  </resolvers>
  <modules>
    <module organisation='NA' resolver='local' />
  </modules>
</ivysettings>

And declare your dependencies as follows:

  <dependencies>
    <dependency org='org.apache.tomcat' name='tomcat-api' rev='7.0.21' />
    ..
    ..
    <dependency org='NA' name='myspecial.jar' rev='NA' />
  </dependencies>

The special "NA" organisation is configured to pull files from the "extlib" directory. The revision attribute is manadatory but generally meaningless when referring to files stored within the project directory.



来源:https://stackoverflow.com/questions/21734368/ivy-build-how-do-i-use-an-extlib-directory-in-the-project

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