Ivy создает неправильную версию в URL-адресе для образца артефакта Maven

У меня возникли проблемы с тем, что Ivy разрешает неправильную последнюю интеграцию для артефакта Maven. Он читает метаданные Maven (очевидно) и определяет, что существует версия 0.0.3-SNAPSHOT. Как ни странно, затем он пытается получить POM, который использует как версию 0.0.3-SNAPSHOT из метаданных, так и версию 0.0.1-SNAPSHOT, которую он мог обнаружить только с помощью метаданных для этой конкретной версии, как вы увидите ниже. . Насколько я могу судить, метаданные Maven в порядке.

Я собрал образец. Простой пустой артефакт Maven и сборка Ivy, которая его разрешает.

Я развернул три версии артефакта Maven в 0.0.1-SNAPSHOT. Каждый раз, когда я просил Айви решить, это было успешно. Когда я обновил версию до 0.0.2-SNAPSHOT, она начала смешивать URL-адреса:

результат решения ant

[ivy:resolve] == resolving dependencies for com.lashpoint.sandbox#maven-test;working@titan [default]
[ivy:resolve] == resolving dependencies com.lashpoint.sandbox#maven-test;working@titan->com.lashpoint.sandbox#test-api;l
atest.integration [default->*]
[ivy:resolve] don't use cache for com.lashpoint.sandbox#test-api;latest.integration: checkModified=true
[ivy:resolve]           tried http://maven.lashpoint.com/content/repositories/public-snapshots/com/lashpoint/sandbox/tes
t-api/[revision]/test-api-[revision].pom
[ivy:resolve]   listing revisions from maven-metadata: http://maven.lashpoint.com/content/repositories/public-snapshots/
com/lashpoint/sandbox/test-api/maven-metadata.xml
[ivy:resolve] CLIENT ERROR: Not Found url=http://maven.lashpoint.com/content/repositories/public-snapshots/com/lashpoint
/sandbox/test-api/0.0.2-SNAPSHOT/test-api-0.0.1-20121214.120300-3.pom
[ivy:resolve]   m2: found md file for com.lashpoint.sandbox#test-api;latest.integration
[ivy:resolve]           => http://maven.lashpoint.com/content/repositories/public-snapshots/com/lashpoint/sandbox/test-a
pi/0.0.1-SNAPSHOT/test-api-0.0.1-20121214.120300-3.pom (0.0.1-SNAPSHOT)
[ivy:resolve]   default-cache: revision in cache (not updated): com.lashpoint.sandbox#test-api;0.0.1-SNAPSHOT
[ivy:resolve]   found com.lashpoint.sandbox#test-api;0.0.1-SNAPSHOT in m2
[ivy:resolve]   [0.0.1-SNAPSHOT] com.lashpoint.sandbox#test-api;latest.integration

ivysettings.xml

<ivysettings>
    <settings defaultResolver="m2" />   
    <resolvers>
            <ibiblio name="m2" m2compatible="true" changingPattern=".*SNAPSHOT"
                checkmodified="true" root="http://maven.lashpoint.com/content/repositories/public-snapshots"  />
    </resolvers>
</ivysettings>

ivy.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info organisation="com.lashpoint.sandbox" module="maven-test"
        status="integration">
    </info>

    <dependencies>
        <dependency name="test-api" org="com.lashpoint.sandbox"
            rev="latest.integration" />
    </dependencies>
</ivy-module>

build.xml

<project name="maven-test" xmlns:ivy="antlib:org.apache.ivy.ant">

    <property name="ivy.jar.dir" value="${user.home}/.ivy2/jars" />
    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />

    <!-- ================================= 
                target: load-ivy  
             ================================= -->
    <target name="load-ivy">
        <mkdir dir="${ivy.jar.dir}" />
        <path id="ivy.lib.path">
                <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
        </path>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
                            uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    </target>    

    <ivy:settings file="ivysettings.xml" />

    <target name="resolve">
        <mkdir dir="lib"/>

        <ivy:resolve file="ivy.xml" refresh="true" />
        <ivy:retrieve pattern="lib/[artifact].[ext]" />
    </target>

</project>

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.lashpoint.sandbox</groupId>
    <artifactId>test-api</artifactId>
    <version>0.0.2-SNAPSHOT</version>

    <distributionManagement>
        <repository>
            <id>lashpoint-snapshots</id>
            <uniqueVersion>true</uniqueVersion>
            <name>Lashpoint Public Snapshots</name>
            <url>http://maven.lashpoint.com/content/repositories/public-snapshots</url>
        </repository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <compilerId>javac</compilerId>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

person Nick Spacek    schedule 14.12.2012    source источник


Ответы (1)


Я сообщил об ошибке, и она была исправлена ​​для версии 2.3.0: https://issues.apache.org/jira/browse/IVY-1396

person Nick Spacek    schedule 26.12.2012