我的理解是,<ivy:resolve/>
将配置的 repo 中的依赖项复制到本地 Ivy 缓存(根目录下${USER_HOME}/.ivy2
)。但是看了任务的文档后,惊讶的发现没有resolver
属性,比如:
<ivy:resolve file="ivy.xml" conf="compile" resolver="theResolverToUse"/>
所以我问:你如何指定使用哪个解析器,特别是如果(在ivysettings.xml
),你可以定义 1+ 解析器?提前致谢。
更新:
例如,这是我的 (emerging) 中定义的解析器片段ivysettings.xml
:
<resolvers>
<chain name="chainResolver" returnFirst="true">
<url name="urlResolver">
<ivy pattern="${ivyRepoRoot}/module_descriptors/${ivyModDescriptorPattern}"/>
<artifact pattern="${ivyRepoRoot}/artifacts/${ivyArtifactPattern}"/>
</url>
<filesystem name="localFileResolver">
<artifact pattern="${user.home}/.ivy2/local-cache/[artifact]-[revision].[ext]"/>
</filesystem>
</chain>
<sftp name="publisherResolver" user="fizz" userPassword="buzz" host="example.com">
<ivy pattern="sftp://example.com:22/usr/local/apache/htdocs/ivy/module_descriptors/${ivyModDescriptorPattern}"/>
<artifact pattern="sftp://example.com:22/usr/local/apache/htdocs/ivy/artifacts/${ivyArtifactPattern}"/>
</sftp>
</resolvers>