SlideShare a Scribd company logo
1 of 27
Download to read offline
Maven beyond “Hello world”
by Gabriel Dogaru
What / why / how?
● Corporate environment
● Build large projects
● 10+ modules
Some hate maven
Maven builds are an infinite cycle of despair that
will slowly drag you into the deepest, darkest pits
of hell (where Maven itself was forged).
http://kent.spillner.org/blog/work/2009/11/14/java-build-tools.html
“Sounds like my first wife.”
David Letterman
What do I need ?
● Stable builds
● Reproducible builds
● Reports
● Releases
● Control over source code and dependencies
● Build automation
● Easy development cycle
● What else ???
Do you know a ninja?
● Developers are smart
● Make builds fool proof
● Have a build team
Control your sources
Install an maven repository manager
http://maven.apache.org/repository-management.html
Resolving dependencies
http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise
Deploying dependencies
http://today.java.net/article/2010/01/04/maven-repository-managers-enterprise
~/.m2/settings.xml
Control dependencies
● Use a parent pom (super pom)
● maven-enforcer-plugin
Parent pom example
http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html
Use dependency management
The Bigger, The Better
● Have many modules
● Your IDE loves modules
● Try to have separate modules if that makes
sense for you
● Do you really need multi module projects?
http://monkeyisland.pl/2010/12/11/ide-and-patterns-for-huge-maven-project/
All for One
one project => one artifact.
Respect thy MAVEN
http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
Know your goals
Know who you are
● Define your own archetypes
● Define your own packaging
http://maven.apache.org/guides/mini/guide-creating-archetypes.html
Groovy example
http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven
Your build is unique
http://www.sonatype.com/books/mcookbook/reference/ch02s03.html
http://ronalleva.com/groovy/maven/programming/2008/01/23/using-the-groovy-maven-plugin-to-do-magic.html
Leave your SNAPSHOT alone
Now we release
The release plugin
http://maven.apache.org/maven-release/maven-release-plugin/
Gets along well with CI
Make nice reports
http://maven.apache.org/plugins/maven-site-plugin/
http://mojo.codehaus.org/sonar-maven-plugin/
Remember
● Maven is not that bad, could be pretty nice
● Customize maven to fit your need
● but respect the tool
● You are never done
● Have a master near by that knows the tool
● Have a look at Gradle....
Thank You

More Related Content

What's hot

Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present future
lolopetit
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 
2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET
Daniel Fisher
 

What's hot (20)

From zero to hero with React Native!
From zero to hero with React Native!From zero to hero with React Native!
From zero to hero with React Native!
 
Continuous delivery with open source tools
Continuous delivery with open source toolsContinuous delivery with open source tools
Continuous delivery with open source tools
 
Android Modularization
Android ModularizationAndroid Modularization
Android Modularization
 
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
 
Groovy in the Cloud
Groovy in the CloudGroovy in the Cloud
Groovy in the Cloud
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 
React Django Presentation
React Django PresentationReact Django Presentation
React Django Presentation
 
Gradle presentation
Gradle presentationGradle presentation
Gradle presentation
 
Provisioning environments. A simplistic approach
Provisioning  environments. A simplistic approachProvisioning  environments. A simplistic approach
Provisioning environments. A simplistic approach
 
jQuery plugin & testing with Jasmine
jQuery plugin & testing with JasminejQuery plugin & testing with Jasmine
jQuery plugin & testing with Jasmine
 
Counterclockwise past present future
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present future
 
ng4 webpack and yarn in JHipster
ng4 webpack and yarn in JHipsterng4 webpack and yarn in JHipster
ng4 webpack and yarn in JHipster
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
Stop Sucking at Building Stuff!
Stop Sucking at Building Stuff!Stop Sucking at Building Stuff!
Stop Sucking at Building Stuff!
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
 
When Web meet Native App
When Web meet Native AppWhen Web meet Native App
When Web meet Native App
 
Magento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HRMagento Continuous Integration & Continuous Delivery @MM17HR
Magento Continuous Integration & Continuous Delivery @MM17HR
 
2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET
 

Viewers also liked (7)

Android Made Simple
Android Made SimpleAndroid Made Simple
Android Made Simple
 
Android Pro Recipes
Android Pro RecipesAndroid Pro Recipes
Android Pro Recipes
 
Grails
GrailsGrails
Grails
 
WaveMaker Presentation
WaveMaker PresentationWaveMaker Presentation
WaveMaker Presentation
 
The Groovy Way
The Groovy WayThe Groovy Way
The Groovy Way
 
Modern Rapid Application Development - Too good to be true
Modern Rapid Application Development - Too good to be trueModern Rapid Application Development - Too good to be true
Modern Rapid Application Development - Too good to be true
 
How to define an api
How to define an apiHow to define an api
How to define an api
 

Similar to Maven beyond hello_world

Similar to Maven beyond hello_world (20)

How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony AlvarezDevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
 
Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)Maven: from Scratch to Production (.pdf)
Maven: from Scratch to Production (.pdf)
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
Make Local WordPress Development Simple
Make Local WordPress Development SimpleMake Local WordPress Development Simple
Make Local WordPress Development Simple
 
Docker. Does it matter for Java developer ?
Docker. Does it matter for Java developer ?Docker. Does it matter for Java developer ?
Docker. Does it matter for Java developer ?
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
 
Vagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentVagrant for local and team WordPress Development
Vagrant for local and team WordPress Development
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Vagrantfordevops
VagrantfordevopsVagrantfordevops
Vagrantfordevops
 
Maven
MavenMaven
Maven
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Development with Vagrant
Development with VagrantDevelopment with Vagrant
Development with Vagrant
 
Continuous Integration with Maven for Android apps
Continuous Integration with Maven for Android appsContinuous Integration with Maven for Android apps
Continuous Integration with Maven for Android apps
 
PowerCLI administration with a Windows Docker image
PowerCLI administration with a Windows Docker imagePowerCLI administration with a Windows Docker image
PowerCLI administration with a Windows Docker image
 
ContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven Infrastructure
 
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
 
Virtualisation - Vagrant and Docker
Virtualisation - Vagrant and DockerVirtualisation - Vagrant and Docker
Virtualisation - Vagrant and Docker
 
IBM Bluemix - Building a Project with Maven
IBM Bluemix - Building a Project with MavenIBM Bluemix - Building a Project with Maven
IBM Bluemix - Building a Project with Maven
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Maven beyond hello_world