I have been using maven for years now but have just realised the need to understand the actual time (maven phase) when the dependencies would be downloaded. I have read maven docs but could not find the actual phase at which the dependencies would get downloaded.
Below is the simplified explanation of my use case:
I have a Jenkins Build job which has 2 stages (since, my code is dependent on snapshots of other internal projects, I am using -U to update the snapshots as I want to build my code with the latest snapshots of other projects):
1. Fast check (check if all the code compiles)
mvn test-compile -U
3. Slow check (build and unit test the whole code)
mvn verify -U scoverage:report-only
Now, while step 1 was getting executed, if someone updates the snapshot of a dependency, I would be running my test-compile and verify goals on different snapshots.
I would like to avoid that and am wondering if I remove -U from the step 2, would all the dependencies still be updated when step 1 was run? Or, could there be a case where step 1 only downloaded the dependencies that were relevant to it to run the test-compile phase while verify phase needed a super-set of dependencies?