分类器在IVY的Maven快照存储库中不起作用 [英] Classifiers not working in Maven Snapshot repo for IVY
问题描述
因此,我有了Maven构建,将Java5和Java6版本都部署到了快照仓库(Nexus).我使用构建配置文件和分类器来完成此操作.在Maven方面,一切都很好.
So I have got my Maven build deploying both Java5 and Java6 versions to my snapshot repo (Nexus). I do this with build profiles and classifiers. All is good in the Maven side of things.
但是,如果我尝试从基于IVY的项目中解决Java5依赖关系,那么如果最新的Maven部署是针对Java6概要文件/分类器的,则它将无法正常工作.我猜这是因为maven-metadata.xml
中的时间戳挑选了Java6版本.如果最新的部署是针对Java5的,那么它确实可以工作.
However, if I try to resolve the Java5 dependency from my IVY based project it will not work if the most recent Maven deploy was for the Java6 profile/classifier. I guess this is because the timestamp in maven-metadata.xml
picks out the Java6 version. It does work if the most recent deploy was for Java5.
这是解析器:
<ibiblio name="snapshot-repo-name"
m2compatible="true"
root="snapshot-repo-root"
pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
usepoms="true"
checkmodified="true"
changingPattern=".*SNAPSHOT"/>
因此,部署依赖项的Java6会中断IVY生成的应用程序的构建.
Deploying Java6 of the dependency therefore breaks the build of IVY-built application.
推荐答案
解决方法是在<distributionManagement/>
元素中将Maven快照标记为非唯一版本.也就是说,Maven快照存储库中不再有时间戳版本.
The work-around is to mark the Maven snapshot as non-unique versions in the <distributionManagement/>
element. That is, there are no longer timestamped versions in the Maven snapshot repository.
<distributionManagement>
<repository>
<id>PROJECT-RELEASE</id>
<name>PROJECT-RELEASE</name>
<url>http://foo.bar:8081/nexus/content/repositories/PROJECT-RELEASE</url>
</repository>
<snapshotRepository>
<id>PROJECT-SNAPSHOT</id>
<name>PROJECT-SNAPSHOT</name>
<uniqueVersion>false</uniqueVersion>
<url>http://foo.bar:8081/nexus/content/repositories/PROJECT-SNAPSHOT</url>
</snapshotRepository>
</distributionManagement>
这篇关于分类器在IVY的Maven快照存储库中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!