Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
My Maven Guide
Maven : My Guide
Based on my experiences and learnings
What is Maven?
Maven is a project development management and comprehension tool. Based on the concept of a project object model: builds, dependency management, documentation creation, site publication, and distribution publication are all controlled from the pom.xml declarative file.
Why Maven ? What problem does maven solve?
- convention over configuration
- Strucure of program
- Build process - clean compile package install deploy site etc
- packaging - jar/war/pom
- versioning - GAVC
- Dependency Mgmt - direct and transitive
- project information
- ease automation
How Maven Works?
Install and configure
Create project and Identify deliverable and packaging GAVC
Add Dependencies declaratively in pom.xml
build project deafult configuration
customize build : maven plugins and their goals with build life cycle phases
build profiles
Repository: install(Local) vs deploy(Remote) artifact(deliverable)
Documentation of project
How to use Maven?
Can Run In/With
cli tools : mvn
Ide : eclipse and Intelli-j Idea
CD/CI tools
Key points in Maven:
project Strucutre
build lifcycle and plugin goals
dependency management
artifact Identification
maven profiles
Who uses maven and for what?
Uses may changes according to Roles.
Developers , QA and Testers, Dev-ops,Tech Managers/Leads
Create project
Dependency Management
Build and Run in various environment (dev,test,qa,prod) and tools (ide,CD/CI,CLI,Containers)
Uses Profiles for configuration
run unit tests and integration tests
Run Tests
Generate Test Reports and Analyse
installation and configuration of tools build tools
CD/CI Jenkins,Bamboo,Travis,TeamCity,GoCD etc
COnfig Mgmt Puppet,Chef,Ansible etc
Automate Build process - configure with CD-CI tools
manage Local and Remote/Central repository
Product Feature and release version maintainance
Project Data :
Team with members
Source control Data
Document generation
Integrate Tools like sonar-qube for Code Quality and Technical Debt etc
Convention over configuration
lots of plugins
evolved and stable
easy to use compared to use: get up running quickly
portable , uses xml for pom
verbose compared to newer technology like gradle. Lengthy xml files
Less Flexible compared to gradle, gradle itself based on scripting language Groovy
NO DSL as available in gradle
Alternatives to maven
ant with ivy
Quick and Dirty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment