Last Updated on by
Apache Maven is one of the most extensively used build tool mainly for Java applications. It provides great assistance to the software developers throughout the project lifecycle.
Get to know about the DevOps process lifecycle & about the prominent DevOps tools through experts training by joining for DevOps Training In Hyderabad program by Kelly Technologies.
What Exactly Maven Do?
Maven helps the developers with
- Compilation of Source Code
- Running Tests (unit tests and functional tests)
- Packaging the results into JAR’s,WAR’s,RPM’s,etc..
- Upload the packages to remote repo’s (Nexus,Artifactory)
Some Prominent Aspects About Maven-
Now, let’s take a look at some of the prominent aspects about Maven
Maven Build Lifecycle-
There a set of conventions which Maven sets & follows. These conventions are flowed right from the very beginning of the project structure to building steps. Following these conventions in a project can get the build lifecycle done smoothly.
Speaking of the build lifecycle, there are three built-in steps namely ‘clean’, ‘default’ and ‘site’. A life cycle has multiple phases. To explain this let’s take the example of the ‘default’ lifecycle which exhibits the following phases
- Compile — Compiles The Source Code
- Test — Executes Unit Test Cases
- Package — Bundles The Compiled Code (Ex: War / Jar)
- Install — Stores The Built Package In Local Maven Repository
- Deploy — Store In Remote Repository For Sharing
In Maven, all the build artifacts (the dependent files & build outcome) gets stored in the Repository. Local and remote are the two different types of repositories in Maven.
Local Maven repository exists within the user’s system & is used for storing the copy of the dependent files, whereas the Remote maven repository is setup by a third party(nexus). It is used to permit access to access and distribute dependent files.
Mavens Project Object Model fundamental is its fundamental unit of work. It is an XML file which exists inside the directory of the project. The project builds configuration settings gets stored in POM.
Kumar Raja is a multidisciplinary writer, and lifelong learner. He’s a Digital Marketer in the making who spends his time analyzing the developments in the tech world. He’s very passionate about helping people understand the latest trends in the tech world through his well-researched articles. He’s able to condense complicated information about the latest technologies into easily digestible articles.