1

Ivy + Maven 快照 + rev="latest.revision" 有问题。Ivy 正在正确解析元数据以发现工件的最新版本,但它似乎拒绝下载它。我坚持使用该工件的早期版本。下面的文字是否给任何人任何想法它为什么这样做?

[ivy:resolve]   listing revisions from maven-metadata: http://my-maven/content/repositories/snapshots/ca/spacek/api-project/maven-metadata.xml
[ivy:resolve]   my-snapshots: found md file for ca.spacek#api-project;latest.integration
[ivy:resolve]           => http://my-maven/content/repositories/snapshots/ca/spacek/api-project/0.0.3-SNAPSHOT/api-project-0.0.3-20121211.132856-8.pom (0.0.3-SNAPSHOT)
[ivy:resolve]   my-snapshots: revision already resolved: ca.spacek#api-project;0.0.3-SNAPSHOT

我看着这个并尝试设置pattern相同,但它似乎没有帮助。我希望避免这样的解决方法

4

1 回答 1

1

下载快照对我有用。我在下面提供了一个工作示例。可以提供更多细节吗?

我过去看到过 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>
于 2012-12-12T00:07:59.133 回答