简体   繁体   English

Maven的本地回购版本工件

[英]maven Local Repo version artifactory

How to differentiate between jars of same version present in local maven repo and artifactory. 如何区分本地Maven存储库和工件中存在的相同版本的jar。

Say for example sample-1.0.jar is present in local maven repository and also the same resides in artifactory but with latest code. 举例来说,本地Maven存储库中存在sample-1.0.jar,并且同样存在于工件中,但具有最新代码。

I need the jar(with latest code) from artifactory during maven build.(without clearing the local repo) 我需要在Maven构建期间从工件中获取jar(带有最新代码)。(无需清除本地存储库)

Please try with -U command while making the build. 进行构建时,请尝试使用-U命令。 This is for force updating the local repo. 这是为了强制更新本地存储库。 this may help you 这可能对您有帮助

There is no way you can do it. 您无法做到。 That's because the assumption is - you shouldn't have two different binaries under the same version (except of snapshots). 那是因为假设是-在同一版本下,您不应有两个不同的二进制文件(快照除外)。 Both Maven and Artifactory operate under this assumption and there is no way to override it. Maven和Artifactory都在此假设下运行,并且没有任何方法可以覆盖它。

Bottom line: 底线:

  1. Don't have different binaries under same version. 同一版本下没有不同的二进制文件。
  2. the only way is to clean local repo (you might of a maven plugin to do that if you can't fix the problem with conflicting binaries). 唯一的方法是清除本地存储库(如果无法解决二进制文件冲突的问题,则可以使用Maven插件执行此操作)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM