In addition, the above mentioned plugins also support bumping the version number to the next SNAPSHOT for a future development cycle right after the build for the release completes. A project during its release can shed the -SNAPSHOT through many means, two of which were covered above. Ideally, since a POM is modified during development, it is best to use the -SNAPSHOT suffix in the POM. Link to the goals page for the maven-release-plugin: What type of version to use in a POM? A goal update-versions in the plugin allows for setting versions. (Group and artifact: : maven-release-plugin) is another means of controlling versions. Link to the goals page for the versions-maven-plugin: Using a maven-release-plugin The plugin has several other goals that are quite useful. The plugin has a goal use-releases that removes the SNAPSHOT. (Group and artifact: : versions-maven-plugin). Two sample mechanisms commonly used are detailed below. The build sanctity is potentially violated with any change made in code, hence using an automated process to update the version are preferred. Versions can be manually altered prior to a build. There are several ways to convert a SNAPSHOT version to a release when the time comes. Version schemes for such artifacts may have no suffix or may have an alternate suffix such as -FINAL or -RELEASE or -GA etc. The artifacts produced from this build are immutable. Such builds are commonly called release builds. Any further change would have to be scoped into another future build, with a different version. The artifact produced from building the project can be marked immutable. Once all desired group of changes are verified/tested, a project reaches a release cycle. Mutability is both a benefit and a liability. Other projects that depend on this project can also avail the latest changes with a re-build and no other version changes.Ī version with a SNAPSHOT suffix is a mutable artifact that eases the development cycle. Deployments can rely on this SNAPSHOT version as a coordinate to get the latest artifact. Metadata for the produced artifact gets an update, but the version remains constant throughout the development cycle. The project POM declares its coordinates with the SNAPSHOT suffix and iteratively builds newer artifacts. A SNAPSHOT version is usually the same as the targeted final version with a suffix of -SNAPSHOT. As a solution maven provides what is known as a SNAPSHOT version. In addition, if other projects depend on such an artifact, it can cause ripple effects while updating the version number from each build. Each deployment where this artifact gets tested will need to update a version number. Changing version numbers for each change in code will produce too many throw-away versions. Common Version naming conventions Development cycleĭuring a development cycle, code is often altered. Maven uses the version as a coordinate in identifying an artifact. Some plugins may build additional intelligence for such. Maven does not understand version schemes and cannot compare versions using numeric (or alphanumeric) comparisons. A quick recap, a version is a string that uniquely identifies a set of changes made to the project. In Part 3, version schemes in Maven were briefly covered. In Part 9 of the series, versions in maven are covered. Link to an index, to find other blogs in this series.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |