【发布时间】:2015-11-25 07:54:30
【问题描述】:
我正在使用 Apache Ivy 来管理传递依赖项。
使用 Maven 是一种很好的体验,因为如果有任何依赖项在远程目录中不可用或在不同版本中可用,那么 Maven 会有效地管理这些。
但是,在我的情况下,Ivy 遇到了这个问题,因为我正在尝试管理 Mule 依赖项,但是 Ivy 很难管理,而 Maven 可以很好地管理它而没有任何问题。
更重要的一点是,我什至不能排除任何依赖项,因为我不想排除,但我希望 Ivy 有足够的能力,以便它可以管理所有依赖项或任何其他方式(如果有)。
下面是错误的屏幕截图以及必要的 XML 文件。
ivy.xml
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info
organisation="MyOrganization"
module="TestForIvySupport"
status="integration">
</info>
<dependencies>
<dependency org="org.mule" name="mule-core" rev="3.6.0"/>
</dependencies>
ivysettings.xml
<settings defaultResolver="chained"/>
<resolvers>
<chain name="chained">
<url name="custom-repo">
<ivy pattern="https://repository.mulesoft.org/nexus/content/groups/public/org/[organisation]/[module]/[revision]/ivy-[revision].xml"/>
<artifact pattern="https://repository.mulesoft.org/nexus/content/groups/public/org/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
</url>
<ibiblio name="ibiblio" m2compatible="true" root="http://mirrors.ibiblio.org/maven2/"/>
<ibiblio name="ibiblio1" m2compatible="true" root="http://repo1.maven.org/maven2/"/>
</chain>
</resolvers>
build.xml
<project name="test ivy" default="test" xmlns:ivy="antlib:org.apache.ivy.ant">
<target name="test" description="Test ivy installation">
<ivy:settings file="ivysettings.xml"/>
<ivy:retrieve sync="false" pattern="myfolder/[artifact]-[revision].[ext]"/>
</target>
【问题讨论】:
-
您使用的是 ivysettings 文件吗? Maven Central 中不存在 groupid “org.mule.extensions”:search.maven.org/#search|ga|1|g%3A%22org.mule.extensions%22
-
你好,马克,到目前为止我还没有使用任何 ivysettings 文件。但是,如果 Maven 自己处理所有这些依赖项,那么为什么 Ivy 不处理包括 mule 依赖项在内的那些。
-
检查我包含的链接。 Maven Central 中不存在依赖项,这就解释了 ivy 失败的原因。这就是为什么我问你是否使用了 ivysettings 文件。我推测您可能是从另一个 Maven 存储库下载的。
-
嗨,马克,我已经更新了这个问题,请再次解决这个问题,因为我还在为此苦苦挣扎。