[ https://issues.apache.org/jira/browse/MNG-7539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17807844#comment-17807844 ]
Tamas Cservenak edited comment on MNG-7539 at 1/17/24 6:23 PM: --------------------------------------------------------------- Just to be on safe side, went to reproduce, but cannot. Here is a demo project: https://github.com/cstamas/mng-7539 It has 3 modules and all 3 depends on SAME SNAPSHOT artifact that comes from ASF snapshots repo, that IS defined as "always" update. FIRST invocation (with empty local repo) pulls a LOT, but as you can see ONLY pulls in mod-a, while NOTHING in mod-b and mod-c: https://gist.github.com/cstamas/1a9af9ebc8ba99c9f3a7f531d2b49b81 To prove how "always" work, immediate subsequent invocation of same comment (local repo is prepopulated), it looks like this: https://gist.github.com/cstamas/7e18a234f77e4322f425d7ea7f1597dc As you can see, maven-core and related SNAPSHOT artifacts ARE re-checked for modification (as policy is "always"), but it happens again ONLY ONCE, at first module. Basically, the "always" policy works exactly you propose to work: "always/once per session". Now am curious to see your reproducer... Edit: Maven version {noformat} [cstamas@angeleyes MNG-7539 (main)]$ mvn -v Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae) Maven home: /home/cstamas/.sdkman/candidates/maven/current Java version: 21.0.1, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/21.0.1-tem Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "6.6.11-200.fc39.x86_64", arch: "amd64", family: "unix" [cstamas@angeleyes MNG-7539 (main)]$ {noformat} was (Author: cstamas): Just to be on safe side, went to reproduce, but cannot. Here is a demo project: https://github.com/cstamas/mng-7539 It has 3 modules and all 3 depends on SAME SNAPSHOT artifact that comes from ASF snapshots repo, that IS defined as "always" update. FIRST invocation (with empty local repo) pulls a LOT, but as you can see ONLY pulls in mod-a, while NOTHING in mod-b and mod-c: https://gist.github.com/cstamas/1a9af9ebc8ba99c9f3a7f531d2b49b81 To prove how "always" work, immediate subsequent invocation of same comment (local repo is prepopulated), it looks like this: https://gist.github.com/cstamas/7e18a234f77e4322f425d7ea7f1597dc As you can see, maven-core and related SNAPSHOT artifacts ARE re-checked for modification (as policy is "always"), but it happens again ONLY ONCE, at first module. Basically, the "always" policy works exactly you propose to work: "always/once per session". Now am curious to see your reproducer... > 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: Major > > 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)