Updated April 1, 2023
Introduction to Maven Versions
Maven is a tool that can be used for project development management and comprehension. The main goal is to control all the activities such as builds, dependency management, documentation creation, site and distribution publication from a central place/file named pom.xml. POM stands for the project object model. Apart from this, it can be extended by using plugins for other development tools for the build process and reporting.
The origin of the maven can be traced back to when the developers faced many complexities and hardships while building a project named Jakarta Turbine Project. It consisted of many projects each having its own Ant build files that were all a bit different and JARs of all of them needed to be checked out at VCS i.e Version Control System like git and subversion. They wanted a standard way to build the project and view all the information about it in a consistent manner. The requirement also consisted of an easier way of publishing the project and a way in which multiple JARs could be shared across all projects. This is where they came up with building such a tool for Java-based projects.
The latest and recommended version released by Apache Maven is 3.6.3. The goal is to increase performance, improve usability, allow safe embedding and ensure backward compatibility with Maven 2. The maven release is independent of the available plugins. Further releases of plugins will be made separately.
For installing refer to this link, https://maven.apache.org/install.html
If already installed, You can check the version by running the command mvn -v on the command prompt. Make sure that your PATH and M2_HOME environment variables are set properly. Presently, Maven Releases can be divided into three, which are as follows- Maven 1.x – It’s outdated and not used presently by anyone. Maven 2.x – Even this release has come to end and has not been used. Maven 3.x – Latest one and recommended to use.
Versions of Maven with Features
Versions of maven with features are given below:
Maven 1.x
Maven 1 came up with some basic and crucial features and functions which are as follows-
Features Of Maven Version 1.x
- The first and most important one of them was that by using maven 1.x, we didn’t need to write the scripting files to build the number of projects into JAR, WAR, or other predefined output. Maven does the building process automatically from the metadata of the
- It can generate the website or pdf of the project development status and documentation and all other references you want by using the same metadata of the project
- It integrates with the VCS of the source control system and helps in the release process with the help of a tag. It also allows us to release the project individually by JAR formation and even to distribution places for use by other
- Maven Repository contains a large number of JARS and other dependencies that might be required while developing our project. Central Repository is maintained where required JARS are downloaded and stored. This can be accessed across the projects and backward compatibility issues are also dealt as it encourages communication between the projects.
- It allowed Gump Integration. Gump was the first tool built by apache which helps in backward compatibility with clients and remains closely informed about the changes in your
Maven 2.x
Maven 2 was completely rewritten. It was not backward compatible as Maven 1. It wasn’t able to execute maven 1 plugins. The architecture makes maven faster and smaller. Command-line execution became faster as maven 2 depended upon fewer dependencies which also helps in smaller distribution. It changed the way extensions were built for maven 1 using scripting and for maven 2 it encouraged the developer to use java beans and plugins. Priorly, the properties file was used to store the private configuration information like credentials(username and password). However, Maven 2 brought settings.xml which replaced the properties file. All private information was then declared in pom.xml.
Features Of Maven Version 2.x
- It helps us to set up the project which follows best practices and is well structured and which can be done in very less
- The project structure is consistent which reduces the time taken to understand the project by newly joined
- Dependency management is achieved easily by automatic updating and transitive dependencies or dependency
- We can work on multiple projects at the same
- Maven Central Repository provides us with many libraries and metadata to maintain Open Source Projects in their latest releases for real-time As it is an opensource tool, it’s extensible and we can do this by writing plugins in java or scripting language.
- New features can be used in projects with little or no
- We can achieve dependency management and deployment outside the maven using ANT tasks.
- No need for scripting for building the projects as maven follows model-based builds which help in predefined outputs like JAR, WAR, or other distribution based on metadata of the project.
- Maven can generate a website of pdf in which any documentation of ours can be included and adds it to standard reports about the status of development of a project by using metadata for the build
- Maven integrates with our version control system like subversion or git to manage the release of the project based on tags which contribute to release management. It can also publish individual outputs like
- Maven Repository contains a large number of JARS and other dependencies that might be required while developing our project. Central Repository is maintained where required JARS are downloaded and stored. This can be accessed across the projects and backward compatibility issues are also dealt as it encourages communication between the projects.
Maven 3.x
Maven 3 provides all the features of Maven 2.
Features Of Maven Version 3.x
- Maven 3 has six-week cycles the same as things work in eclipse. This gives developers a general idea that their bugs will be fixed within a few weeks and will be available in the next
- It has separate repositories for project dependencies and plugin dependencies while Maven 2 shared a common repository for both which caused problems if project dependencies were locked by controlling repositories which lead to plugin dependency
- It supports a parallel build. But it restricts the plugins to be declared thread-safe for build
- It is easier to embed. It maintains consistency between your command-line interface and integrated development
- Logging has been improved in Maven 3.Artifact Id of the project is mentioned, versions of plugins are included, and also the indentation and overall readability is improved by adding new lines and
- The time required for the building is very less as compared to Maven 2. It also requires much less memory because of better
- POM validity is improved in Maven 3. It checks for proper structure and informs us whenever it feels like the xml declared by us can cause problems in the future. For example, it will show an error if the plugin version is not mentioned or the same dependencies are mentioned multiple times.
It can be said that the overall maven will prove helpful in maintaining project structure, dependencies, and releases effectively and easily for our projects. The latest version of the maven should be used so that you can take advantage of new features and bug fixes. Maven Version 3.6.3 is the latest and most recommended version to be used.
Recommended Articles
This is a guide to Maven Versions. Here we discuss the introduction and Versions of maven with its features. You may also look at the following articles to learn more –