The dependencies are resolved on a need-by-need basis:
The compile time ones for the application's code are downloaded as a very first step when you start the build.
Any plugins required are downloaded afterwards during the respective phases. This also includes their transitive dependencies.
The dependencies for the tests are downloaded when the tests are to be compiled and executed. These are the dependencies with
<scope>test</scope>
.
Therefore, at the point where you're at the test
phase, you already must have the latest dependencies, unless you have them cached locally and installed and you're in offline mode.
To resolve all your dependencies, you can do:
mvn dependency:go-offline
To resolve all the plugins, you can do:
mvn dependency:resolve-plugins