For a jar package, how does maven determine that the remote repository's jar package is newer than the corresponding jar package in the local repository? When I redeploy to a new, the next maven command will automatically download the latest jar package, so how does maven know to update it?
There is no definitive answer to this question on the Internet.
So, I ventured to guess that the new and old extent of the jar package could be judged by timestamps or checksums.
Conjecture 1: Time stamp
When deployed, a current timestamp is logged, and the timestamp of the jar that we download to the local repository is the timestamp of the last update of the jar package. After that, the time stamp of the package deployment is changed, and the timestamp of the local jar package is more than the time stamp of the remote jar package, so it is updated automatically.
Conjecture 2: Checksum (checksum)
After deployment, the checksum of the generated file is updated if the checksum of the local jar package is inconsistent with the remote checksum.
Above, purely personal conjecture, if have more exact answer, hope to enlighten.
This article is from the "ten-li Rice flower" blog, please be sure to keep this source http://5880861.blog.51cto.com/5870861/1695788
The basis for update of JAR packages in maven local warehouse