![]() ![]()
Now that Maven provides these two types of version numbers, what are their advantages and disadvantages before? In what scenarios are they used? Interpreting SNAPSHOT For maven, These are the RELEASE versions. #Difference between snapshot and mailist softwareAlthough there will be beta and rc versions, these are only beta versions from a software engineering perspective. In addition, all version numbers that do not end with -SNAPSHOT are considered to be RELEASE versions, that is, official versions. SNAPSHOT dependencies generally refer to version numbers ending with -SNAPSHOT, such as 1.0.1-SNAPSHOT. In the maven convention, the versions of dependencies are divided into two categories - SNAPSHOT and RELEASE. This time I will first describe the choice of the definition of the version, SNAPSHOT or RELEASE? version war Following the concept of "convention over configuration", maven has many conventions. The learning curve of maven itself is relatively steep. The management and construction of many open source libraries are also based on maven. #Difference between snapshot and mailist downloadAfter the snapshot version of the public library is updated, we do not need to modify the pom file to prompt the version number to download In the new version, you can re-download the latest snapshot library by directly executing the relevant compilation and packaging commands in mvn, which also facilitates our development.Īt present, in the JAVA world, maven has become the de facto construction standard. ![]() Therefore, in the development phase, we can set the version of the public library as the snapshot version, and the dependent components refer to the snapshot version for development. If it is an official release version, it will be automatically released to the official version library when mvn deploy, and using the official version of the module, without changing the version number, if the module of this version already exists locally when compiling and packaging, it will not be Actively go to the mirror server to download. If it is a snapshot version, it will be automatically published to the snapshot repository when mvn deploy, which will overwrite the old snapshot version, and when using the snapshot version of the module, without changing the version number, when compiling and packaging directly, maven will Automatically download the latest snapshot version from the mirror server. Maven2 will judge whether it is a snapshot version or an official version according to whether the version number of the module (version in the pom file) has -SNAPSHOT. To define a component/module as a snapshot version, you only need to add -SNAPSHOT after the version number of the module in the pom file (note that it must be capitalized here), as follows: The snapshot repository is used to save unstable versions in the development process, and the official release repository is used to save stable releases. There are two kinds of warehouses in maven, snapshot snapshot warehouse and release release warehouse. However, if it is based on the snapshot version, then the problem is solved spontaneously, and maven has prepared all this for us. #Difference between snapshot and mailist upgradeIf we are doing dependency management based on the officially released version in the development stage, then when we encounter this problem, we need to upgrade the version number of the component, but this obviously does not meet the requirements and actual situation. For the artifact in the release state, if the version number is the same, even if the components on our internal mirror server are newer than the local, maven will not actively download them. We know that maven's dependency management is based on version management. It may be released once a day, and even N times a day when bugs are encountered. In the process of using maven, we often have many public libraries in an unstable state during the development phase, which need to be modified and released at any time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |