Maven:
Maven is an open-source build tool that was developed by Apache Software Foundation.
Why do we use it in all automation frameworks?
If we create just a normal Java project for automation, then we have to download external libraries/jar files to get a certain number of classes or methods, which come from a specific library.
For example,if we want to use Selenium, then we have to download and add the libraries to the project.
However, this method has a major disadvantage. Searching different libraries from different websites to build our project and also updating is a little hectic because we have to remove and add one by one of all the libraries.
To overcome these two problems, we can create the Maven project.
Whenever we create a Maven project, by default, it creates a POM.xml file and the entire Maven project will be controlled by this pom.xml file. By default, it creates a folder structure.
The POM.xml contains dependencies and plugins sections. By default, POM.xml downloads required dependencies. and the plugin section is used for configuration.
Maven is not only used for storing dependencies and plugins, but it is also used for generating reports and project-related documentation. After completing the project, we can create the project packaging and give it to the clients.
Maven Project Structure:
If we want to change the versions of the libraries we Change the version in POM.xml,once the changes are saved then by default Maven downloads the libraries from a remote repository.
Because of these scenarios, Maven is used in most of the frameworks.