简体   繁体   English

IntelliJ / Maven不会更新Artifactory中的工件

[英]IntelliJ/Maven not updating artifacts from Artifactory

I recently set up a password protected Artifactory server. 我最近设置了一个受密码保护的Artifactory服务器。 A Jenkins server is deploying my artifacts to a maven repository on that Artifactory server. Jenkins服务器正在将我的工件部署到该Artifactory服务器上的maven存储库。

Here is the problem: 这是问题所在:
The new builds are nor available at runtime (in IntelliJ) neither in Maven (when building). 新版本在运行时(在IntelliJ中)也不可用于Maven(构建时)。 To get maven to update, I've to delete the artifacts from my local repo. 为了让maven更新,我将从我的本地仓库删除工件。

How can I tell Maven/IntelliJ to always check for the newest version? 如何告诉Maven / IntelliJ始终检查最新版本?
Even that wasn't doing anything: 即便这样做也没有:

<releases>
    <enabled>true</enabled>
    <updatePolicy>always</updatePolicy>
</releases>
<snapshots>
    <enabled>true</enabled>
    <updatePolicy>always</updatePolicy>
</snapshots>

There are the cases to deal with: 有案件需要处理:

  1. Releases. 发布。 Not Maven nor Artifactory will never check for a newer binary if a release binary of the same version exists in the local cache ( ~/.m2/ repository cache for Maven or remote repository cache for Artifactory). 如果本地缓存中存在相同版本的发布二进制文件(Maven的~/.m2/存储库缓存或Artifactory的远程存储库缓存),则Maven和Artifactory将永远不会检查更新的二进制文件。 The only way to force Artifactory and Maven to re-fetch a release artifact is to delete it from the cache . 强制Artifactory和Maven重新获取发布工件的唯一方法是从缓存中删除它 Do not use the same version for different blob, ever. 永远不要为不同的blob使用相同的版本。
  2. Snapshots. 快照。 Although there is a difference between unique (file names end with timestamps) and non-unique (file names end with -SNAPSHOT and thus they violate the rule I just wrote, so don't use them), their retrieval policy is the same: Maven consider them expirable resources , it will occasionally check for a new blob, posted under the same version. 虽然唯一(文件名以时间戳结束)和非唯一(文件名以-SNAPSHOT ,因此它们违反我刚写的规则,因此不使用它们)之间存在差异,但它们的检索策略是相同的: Maven认为它们是可过期的资源 ,它偶尔会检查一个新的blob,在同一个版本下发布。 Artifactory does the same: occasionally the expirable resource is declared "expired", so next time Maven asks for this resource, Artifactory will fetch to the remote repository to check for a new blob, posted under the same version. Artifactory也是这样做的:偶尔会将可过期资源声明为“已过期”,因此下次Maven请求此资源时,Artifactory将获取远程存储库以检查在同一版本下发布的新blob。 In both tools you can control the cache period and "zap the cache" manually. 在这两个工具中,您可以控制缓存周期并手动“快速删除缓存”。
    • In Maven <update-policy/> controls how often Maven checks for new snpashots, and the --update-snapshots flag forces Maven to check immediately. 在Maven中, <update-policy/>控制Maven检查新snpashot的频率,而--update-snapshots标志强制Maven立即检查。
    • In Artifactory the Retrieval Cache Period parameter in remote repository configuration controls how often Artifactory checks for new snapshots, and the Zap Caches action on the remote repository in the artifact browser screen makes sure that Artifactory will check for new snapshots on the next request. 在Artifactory中,远程存储库配置中的Retrieval Cache Period参数控制Artifactory检查新快照的频率,以及工件浏览器屏幕中远程存储库上的Zap Caches操作,确保Artifactory将在下一个请求中检查新快照。

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

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