Maven中的updatePolicy如何真正起作用? [英] How does the updatePolicy in maven really work?
问题描述
当我在maven设置中定义updatePolicy
时,它会告诉maven应该多久下载一次快照工件.
When I define an updatePolicy
in my maven settings it tells maven how often snapshot artifacts shall be downloaded.
如果我将其设置为始终",则当然每次所有快照都会下载.
If I set it to always it of course downloads every time all snapshots.
我想知道如果每天将其设置为默认值或更长的时间会发生什么情况.
I was wondering what happens if I set it to the default value daily or another longer peroid.
maven是否仍检查快照的新版本,如果有,即使策略规定每天都会下载,也可以下载吗?
Does maven still check whether a new version of the snapshot is available and if so, does it download it although the policy says daily ?
我正在寻找正确的设置,以避免重复下载,并且不要错过新的快照.
I'm looking for the correct settings to avoid redundant downloads and not to miss a newer snapshot out there.
推荐答案
我想知道如果将其设置为每天或更长时间的默认值会发生什么情况.
I was wondering what happens if I set it to the default value daily or another longer period.
存储库-SNAPSHOT处理可能会更好比 POM参考:
项目中的每个存储库都有其 自己的更新政策:
Each repository in the project has its own update policy:
- 始终-始终检查何时启动Maven以获取更新版本的 快照
- 从不-从不检查较新的远程版本.停用手动更新后,即可 被执行.
- 每天(默认)-检查一天的第一轮(当地时间)
- 时间间隔:XXX-每XXX分钟检查一次
- always - always check when Maven is started for newer versions of snapshots
- never - never check for newer remote versions. Once off manual updates can be performed.
- daily (default) - check on the first run of the day (local time)
- interval:XXX - check every XXX minutes
我认为没有任何要添加的内容(也许检查!=下载除外).
I don't think there is anything to add (except maybe that check != download).
maven是否仍检查快照的新版本,如果有,即使策略规定每天都会下载,也可以下载吗?
Does maven still check whether a new version of the snapshot is available and if so, does it download it although the policy says daily ?
好吧,不,为什么呢?
Well, no, why would it?
我正在寻找正确的设置,以避免重复下载,并且不要错过新的快照.
I'm looking for the correct settings to avoid redundant downloads and not to miss a newer snapshot out there.
如果您始终希望Maven下载快照的较新版本(如果可用),请使用always
(Maven将始终检查远程存储库,但仅下载 (如果是较新的版本).
Use always
if you always want Maven to download a newer version of snapshots, if available (Maven will always check the remote repository but only download if the version is newer).
这篇关于Maven中的updatePolicy如何真正起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!