简体   繁体   中英

Ivy working with Maven snapshots “revision already resolved”

Having a problem with Ivy + Maven Snapshots + rev="latest.revision". Ivy is properly parsing the metadata to discover the latest version of the artifact, but it seems to decline downloading it. I'm stuck with an earlier version of the artifact. Does the text below give anyone any ideas why it's doing it?

[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

I looked at this and tried setting the pattern the same, but it didn't seem to help. I'm hoping to avoid workarounds like this .

Downloading snapshots works for me. I've supplied a working example below. Possible to supply more details?

I've seen issues with Maven snapshots in the past but that was because the repository metadata files were not being updated as expected, resulting in the wrong artifact being downloaded.

Another possible issue is a invalid cache. Perhaps you could try and purge it (See the "clean-all" target in the example below).

Example

[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 ...

build.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>

ivy.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>

ivysettings.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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM