我们使用Sonatype Maven仓库。这对于我们的Maven项目非常好,但是我们有一个遗留应用程序使用Ant+IVY进行依赖管理,现在需要从Maven获取依赖。
我的IVY设置文件如下:
<ivysettings>
<property name="dsnexus-root" value="http://internal-url/" override="false"/>
<credentials host="hostname" username="username" passwd="XXXX"/>
<!-- ... -->
<resolvers>
<chain name="shared">
<url name="shared-default">
<!-- ... -->
</url>
<url name="dsnexus-public" m2compatible="true">
<artifact pattern="${dsnexus-root}/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
</url>
</chain>
</resolvers>
<modules>
<module organisation=".*" name=".*" resolver="shared"/>
</modules>
<!-- ... -->
</ivysettings>
但当我尝试解决我的依赖关系时,它无法在内部仓库中找到任何内容。
例如:
module not found: xerces#xercesImpl;2.9.1
==== shared-default: tried
...
==== dsnexus-public: tried
-- artifact xerces#xercesImpl;2.9.1!xercesImpl.jar:
http://internal-url/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
当然,该网址上确实存在dep。
我也尝试过
<ibiblio name="dsnexus-public"
root="${dsnexus-root}"
m2compatible="true"
namespace="maven2"/>
并且得到了相同的结果。
我猜测是我的凭证出现了问题。