Java Ivy在示例Maven工件的URL中生成错误修订

Java Ivy在示例Maven工件的URL中生成错误修订,java,ivy,Java,Ivy,Ivy解决Maven工件的错误最新集成时遇到了一些问题。它正在读取Maven元数据(显然)并确定存在0.0.3快照版本。奇怪的是,它随后尝试从元数据中检索同时使用0.0.3-SNAPSHOT版本和0.0.1-SNAPSHOT版本的POM,而该版本只能使用该特定版本的元数据才能发现,如下面所示。据我所知,Maven元数据很好 我收集了一个样品。一个简单的、空的Maven工件,以及解决它的常春藤构建 我在0.0.1-SNAPSHOT上部署了三个版本的Maven工件。每次我要求艾薇解决问题,都是成功的

Ivy解决Maven工件的错误最新集成时遇到了一些问题。它正在读取Maven元数据(显然)并确定存在0.0.3快照版本。奇怪的是,它随后尝试从元数据中检索同时使用0.0.3-SNAPSHOT版本和0.0.1-SNAPSHOT版本的POM,而该版本只能使用该特定版本的元数据才能发现,如下面所示。据我所知,Maven元数据很好

我收集了一个样品。一个简单的、空的Maven工件,以及解决它的常春藤构建

我在0.0.1-SNAPSHOT上部署了三个版本的Maven工件。每次我要求艾薇解决问题,都是成功的。当我将版本更新为0.0.2-SNAPSHOT时,它开始混合URL:

ant resolve的输出

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

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

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

pom.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>
<?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>
<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>
<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>

4.0.0
com.lashpoint.sandbox
测试api
0.0.2-快照
冲击点快照
真的
Lashpoint公共快照
http://maven.lashpoint.com/content/repositories/public-snapshots
maven编译器插件
2.3.2
爪哇语
1.6
1.6

我报告了一个bug,它已在2.3.0中修复: