如何在Maven中指定依赖关系的存储库 [英] How to specify a repository for a dependency in Maven
问题描述
例如,我想要bouncycastle直接检查BouncyCastle的Maven repo,在 http://repo2.maven.org/maven2/org/bouncycastle/ 而不是官方的Maven。
不可能。 Maven会以声明顺序检查存储库,直到给定的工件得到解决(或不)。
某些存储库管理器可以做一些接近这个的工作。例如,Nexus有一个路线功能与此相当。
In projects with several dependencies and repositories, the try-and-error approach of Maven for downloading dependencies is a bit cumbersome and slow, so I was wondering if there is any way to set an specific repo for some declared dependencies.
For example, I want for bouncycastle to check directly BouncyCastle's Maven repo at http://repo2.maven.org/maven2/org/bouncycastle/ instead of official Maven.
Not possible. Maven checks the repositories in their declaration order until a given artifact gets resolved (or not).
Some repository manager can do something approaching this though. For example, Nexus has a routes feature that does something equivalent.
这篇关于如何在Maven中指定依赖关系的存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!