maven中的updatePolicy到底是如何工作的?

发布于 2024-09-25 06:19:47 字数 226 浏览 5 评论 0原文

当我在 Maven 设置中定义 updatePolicy 时,它会告诉 Maven 快照工件的下载频率。

如果我将其设置为始终,它当然会每次下载所有快照。

我想知道如果我将其设置为每日默认值或另一个更长的周期会发生什么。

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫竹語嫣☆ 2024-10-02 06:19:47

我想知道如果我将其设置为默认值每天或另一个更长的时间会发生什么。

存储库 - SNAPSHOT 处理 解释它可能比 < a href="http://maven.apache.org/pom.html#Repositories" rel="noreferrer">POM 参考:

项目中的每个存储库都有其
自己的更新政策:

  • always - 总是检查 Maven 何时启动以获得较新版本
    快照
  • never - 从不检查较新的远程版本。一旦关闭手动更新可以
    执行。
  • 每日(默认)- 检查当天的第一次运行(当地时间)
  • interval:XXX - 每 XXX 分钟检查一次

我认为没有任何可添加的内容(除了检查!=下载)。

maven 是否仍然检查快照的新版本是否可用,如果是,它是否会下载它,尽管政策规定每天?

嗯,不,为什么会这样呢?

我正在寻找正确的设置,以避免冗余下载,并且不会错过更新的快照。

如果您始终希望 Maven 下载快照的较新版本(如果可用),请使用always(Maven 将始终检查远程存储库,但仅检查 >下载如果版本较新)。

I was wondering what happens if I set it to the default value daily or another longer period.

The Repository - SNAPSHOT Handling explains it maybe better than the POM reference:

Each repository in the project has its
own update policy:

  • 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).

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.

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文