Maven特定版本的快照依赖项 [英] Maven specific version of a snapshot dependency

查看:426
本文介绍了Maven特定版本的快照依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让Maven下载依赖项的特定快照版本?我知道指定这样的依赖关系将下载可用的最新快照:

Is there a way to get Maven to download a specific snapshot version of a dependency? I know that specifying the dependency like this will download the lastest snapshot available:

<dependency>
<groupId>groupid</groupId>
<artifactId>artifact-id</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

是否可以指定特定的快照版本? (例如artifact-id-1.0.0-20090610.041042-5)如果头部快照版本已损坏,并且稳定版本的依赖关系尚未正式发布,则此功能将非常有用.

Is it possible to specify a specific snapshot version? (e.g.artifact-id-1.0.0-20090610.041042-5) This would be useful if the head snapshot build has broken something and the stable version of the dependency has yet to be officially released.

推荐答案

是的,可以.您可以使用Maven存储库中的任何版本.我遇到了一些问题,尽管这些过时的依赖关系使该版本变糟了.这就是mvn dependency:tree派上用场的地方.

Yes, you can. Any version that is in your maven repositories can be used. I've ran into some problems where the trasnsitive dependencies mucked with the version though. That's where mvn dependency:tree came in handy.

  • Maven dependency mechanism
  • mvn dependency:tree

这篇关于Maven特定版本的快照依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆