下载快照对我有用。我在下面提供了一个工作示例。可以提供更多细节吗?
我过去看到过 Maven 快照的问题,但那是因为存储库元数据文件没有按预期更新,导致下载了错误的工件。
另一个可能的问题是缓存无效。也许您可以尝试清除它(请参阅下面示例中的“全部清除”目标)。
例子
[ivy:resolve] :: Apache Ivy 2.3.0-rc1 - 20120416000235 :: http://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: file = /?????/ivysettings.xml
[ivy:resolve] :: resolving dependencies :: myOrg#Demo;????
[ivy:resolve] confs: [default]
[ivy:resolve] found commons-lang#commons-lang;2.7-SNAPSHOT in apache-snapshots
[ivy:resolve] downloading https://repository.apache.org/content/groups/snapshots/commons-lang/commons-lang/2.7-SNAPSHOT/commons-lang-2.7-20120610.132226-5.jar ...
构建.xml
<project name="demo" default="resolve" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="build.dir" location="build"/>
<target name="resolve" description="Use ivy to resolve classpaths">
<ivy:resolve/>
</target>
<target name="clean" description="Cleanup build files">
<delete dir="${build.dir}"/>
</target>
<target name="clean-all" depends="clean" description="Additionally purge ivy cache">
<ivy:cleancache/>
</target>
</project>
常春藤.xml
<ivy-module version="2.0">
<info organisation="myOrg" module="Demo"/>
<dependencies>
<dependency org="commons-lang" name="commons-lang" rev="2.7-SNAPSHOT"/>
</dependencies>
</ivy-module>
常春藤设置.xml
<ivysettings>
<settings defaultResolver="repos" />
<resolvers>
<chain name="repos">
<ibiblio name="central" m2compatible="true"/>
<ibiblio name="apache-snapshots" m2compatible="true" root="https://repository.apache.org/content/groups/snapshots"/>
</chain>
</resolvers>
</ivysettings>