我遇到了一些问题,Ivy解决了错误的最新问题。整合Maven工件。它正在读取Maven元数据(显然)并确定存在0.0.3-SNAPSHOT版本。奇怪的是,它然后尝试检索使用元数据中的0.0.3-SNAPSHOT版本和仅使用该特定版本的元数据发现的0.0.1-SNAPSHOT版本的POM,如下所示。据我所知,Maven元数据很好。
我已经整理了一个样本。一个简单的空Maven工件,以及解决它的Ivy构建。
我在0.0.1-SNAPSHOT部署了三个版本的Maven工件。每当我要求Ivy解决时,它都是成功的。当我将版本更新为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>