Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My Maven Guide
Maven : My Guide
Based on my experiences and learnings
https://en.wikipedia.org/wiki/Apache_Maven
https://maven.apache.org/what-is-maven.html
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
https://maven.apache.org/guides/getting-started/index.html
https://maven.apache.org/archetype/index.html
https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
https://maven.apache.org/guides/introduction/introduction-to-the-pom.html
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
https://maven.apache.org/plugins/index.html
https://maven.apache.org/guides/index.html
https://maven.apache.org/
https://mvnrepository.com/
https://continuousdelivery.com/
https://www.atlassian.com/continuous-delivery/ci-vs-ci-vs-cd
https://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software
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.
https://maven.apache.org/guides/index.html
Why Maven ? What problem does maven solve?
- convention over configuration
- Strucure of program
https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
- 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?
Installation
https://maven.apache.org/guides/mini/guide-configuring-maven.html
Configuration
https://maven.apache.org/settings.html
Can Run In/With
cli tools : mvn
Ide : eclipse and Intelli-j Idea
CD/CI tools
https://maven.apache.org/general.html
Key points in Maven:
project Strucutre
pom.xml
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 https://code-maze.com/top-8-continuous-integration-tools/
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
https://www.atlassian.com/continuous-delivery/ci-vs-ci-vs-cd
Strengths
Convention over configuration
lots of plugins
evolved and stable
easy to use compared to use: get up running quickly
portable , uses xml for pom
Weaknesses
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
https://technologyconversations.com/2014/06/18/build-tools/
Alternatives to maven
ant with ivy
graddle
https://dzone.com/articles/gradle-vs-maven
https://dzone.com/articles/maven-vs-gradle-and-the-best-of-both-worlds
Quick and Dirty
1. https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
<project>
....
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
....
</project>
2. https://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html
3. http://www.vogella.com/tutorials/ApacheMaven/article.html
4. https://www.jfrog.com/confluence/display/RTF/Welcome+to+Artifactory
5. http://www.vogella.com/tutorials/EclipseMaven/article.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment