7/19/2023 0 Comments Nexus repository latest versionNext, we can add a snapshot version of an artifact to our project: never - never try to get a newer version (compared to the one we already have locally)Īdditionally, instead of defining the updatePolicy, we can force an update of all snapshot artifacts by passing the -U argument in the command: mvn install -Uįurthermore, the dependency will not be re-downloaded if it has already been downloaded and the checksum is the same as the one we already have in our local repository.interval:mm - check for a newer version based on an interval set in minutes.daily (default value) - check for a newer version once a day.always - check for a newer version every time.There are four different values we can place inside the updatePolicy element: We can override this behavior by setting a different update policy: However, the default update policy is set to once per day. We need to enable them manually: īy enabling snapshots, we can define how often we'd like to check for a newer version of the SNAPSHOT artifacts. Snapshot versions are not enabled by default. Metadata files help manage translation from the snapshot version to the timestamp value.Įvery time we deploy the project under the same snapshot version, Maven will generate the version containing the new timestamp value and the new build number. The maven-metadata.xml file holds precise information about the snapshot version and its link to the latest timestamp value: ![]() Maven generates the checksum and uploads the artifact’s files with the same timestamp. ![]() The timestamp value is calculated during the artifact deployment. For instance, when we deploy 1.0.0-SNAPSHOT, the actual value will contain the current timestamp and the build number (for example, 1.0.0-20220709.063105-3). After the deployment, the actual artifact version will contain a timestamp value instead of the SNAPSHOT value.
0 Comments
Leave a Reply. |