Build Tools
A build tool, or software utility, is essential in contemporary software development since it automates the transformation of source code into an executable and deployable program.
With build automation, steps like code compilation, assessment, dependency management, & packaging improve the efficiency of the entire development process.
Build tools improve productivity, consistency, and dependability across projects and growth environments by automating repetitive and error-prone activities.
Maven
Maven is a widely used build automation and project management tool in the Java software development ecosystem.
Lifecycle
Maven defines a standard build lifecycle consisting of phases such as compile, test, package, install, and deploy. These phases facilitate the build process in a standardized way.
Project Object Model (POM)
Maven projects are defined by a Project Object Model (POM) file, usually named pom.xml. This XML file contains project configurations, dependencies, plugins, and other information required for building the project.
Maven Project Structure
Lifecycle Commands
Maven is based around the central concept of a build lifecycle. What this means is that the process for building and distributing a particular artifact (project) is clearly defined.
There are three built-in build lifecycles: default, clean and site. The default
lifecycle handles your project deployment, the clean
lifecycle handles project cleaning, while the site
lifecycle handles the creation of your project's web site.
validate the project is correct and all necessary information is available.
compile the source code of the project.
test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
take the compiled code and package it in its distributable format, such as a JAR.
run any checks on results of integration tests to ensure quality criteria are met.
install the package into the local repository, for use as a dependency in other projects locally.
done in the build environment, copies the final package to the remote repository for sharing with other developers and projects.
Maven Repositories
Maven downloads the required artifacts or dependencies (jar files) and other plugins which are configured as part of any project, there must be a commonplace where all such artifacts are placed. This common shared area is called a Repository.
Last updated