[
https://issues.apache.org/jira/browse/MNG-7539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17605780#comment-17605780
]
Adrian Tarau commented on MNG-7539:
-----------------------------------
We tried that, but it does not work. Right now, the update for SNAPSHOT is
{*}always{*}. The reason why it will not work is the following:
* let's say we change the policy *every 15 minutes*
* project A builds, uploads new SNAPSHOT artifacts
* project B builds (and it depends on A, and it did run {*}11 minutes ago{*}),
and the timeout is not reached, it sees the previous version of the artifact,
and the build fails
Finding the correct update policy is tricky, and depending on the build speed,
it introduces flaky behaviors.
I thought of writing an extension to download SNAPSHOTS once, but I feel it
should be built in. We have the following policies:
* 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
A new option can be added "once - check once per build"
> Validate/Download SNAPSHOT dependencies once
> --------------------------------------------
>
> Key: MNG-7539
> URL: https://issues.apache.org/jira/browse/MNG-7539
> Project: Maven
> Issue Type: Improvement
> Components: Dependencies
> Reporter: Adrian Tarau
> Priority: Critical
>
> Building an unreleased multi-module project (30-40 modules) that depends on
> various other unreleased modules puts significant pressure on the Maven
> Repository (a local Nexus instance), and artifact resolution could slow down
> the build 2x-3x.
> I do acknowledge that it is the job of the repository to cache and serve
> those responses fast, and for some reason, sometimes it slows down without an
> apparent reason.
> However, the whole build process will be faster if Maven validates a SNAPSHOT
> once for multi-module (when the dependency is reached the first time) and
> then use that version. Even if Maven Repository is relative fast, there is
> still network traffic done. Outside the fact that it should not be done, it
> might also introduce flaky behaviors:
> * one module downloads a version of artifact A, works with it, and
> everything is fine
> * 10 minutes later, another module needs artifact A and gets a newer
> version, which has some issues, and various (test) failures will be raised
> For consistency, on a multi-module build, all modules should _see_ the same
> version of a SNAPSHOT artifact. It will be faster, and it will be consistent
> (which is very important).
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)