SlideShare a Scribd company logo
Version Mgmt in
Maven
SOME BEST PRACTICES
Agenda
What is software versioning
How can maven help us?
◦ Maven release plugin

Best practices
◦ What to version?
◦ How to manage versions?

Tips and tricks
◦ Version handling with maven-versions-plugin
◦ Dependency analysis with maven-dependency-plugin
Version identifies software artefacts:

Software Versioning

◦ modules, applications, assemblies, …
◦ Uniquely identifies source code
◦ Build should be repeatable from that version of code

Most used:
◦ Major.minor[.bugfix][-qualifier[-build]]

Qualifiers:
◦
◦
◦
◦
◦

Alpha: not feature complete
Beta: contains critical bugs
CR: release candidate, not fully tested
Final: final version
SNAPSHOT
◦ Floating version, not an actual identification
◦ Should allways be used for code under development
Versioning with Source Code
Management
Basics of SCM (Git, Subversion, CVS, …)
◦ Synching software changes between developers
◦ Allowing multiple branches to be developed simultaneously
◦ Maintenance branches
◦ Feature branches
◦ Merge branches again 

◦ Tagging versions of code
◦ So you can find out later which bugs you solved when

SCM does not put a version number in your artifacts!
Version Management in Maven
Maven in a nutshell
Maven Basics
Convention over configuration
◦ Convention for source code organization
◦ src/main/java
◦ src/webapp
◦ src/test/java

◦ Plugins with default configurations
◦ Jar, war, ear
◦ Surefire tests
◦ Reporting

Dependency Management
◦ Remote repository and local repository
◦ Transactional dependencies
Snapshots
In maven, versions under development have classifier ‘-SNAPSHOT’
◦ When building versions on a development system, you should always build SNAPSHOTS.
◦ When depending on a SNAPSHOT version of another module, maven will give you the latest
(timestamped) version
◦ Could give surprises of code that suddenly stops building
◦ Preferrably have the source code of your SNAPSHOT dependencies built locally

Non SNAPSHOT versions should be built only once and deployed once
◦ Should be tagged in Subversion/Git/CVS, and never changed
◦ (Unless you know for sure nobody got a copy yet)

◦ Released versions should never have SNAPSHOT dependencies
◦ See release plugin later
Organizing Maven Modules
Aggregator POM vs. Parent POM
◦ Aggregator POM organizes build of multiple modules
◦ One per subfolder
◦ Declares which subfolders contain modules

◦ Parent POM centralizes common configuration
◦ Plugin configuration
◦ Dependencies
◦ Dependency Management

Convention: Aggregator POM == Parent POM
◦ Exceptions are allowed
Typical Maven Workspace Hierarchy
Workspace POM
◦ Godfather aka archon (development team)
◦ Application System(s) (set of related applications)
◦ Application or Library

◦ Module Group(s) (if necessary)
◦ Module
Workspace POM
Dummy Aggregator POM
Just to launch other POM’s
Can use symbolic links to point to actual application roots to be built.
Godfather POM
Defines <distributionManagement> and <repositories>
◦ <distributionManagement>: where your artifacts are deployed
◦ <repositories>: where other necessary artifacts can be found

Rarely changes
◦ Simple fixed version number, e.g. 1, 2, 3, …

Do not put shared dependencies here
◦ Use maven import (since maven 2.0.9)
Application System POM
Inherits from Godfather
Defines external dependency versions in <dependencyManagement>
Defines common plugin configuration
◦ E.g. java compiler version

Could build an assembly containing all applications
Application or Library POM
Module groups
Defines internal dependency management
◦ Sibling modules
◦ Can use ${project.version}

Define more shared configuration
◦ Inapplicable on a higher level
◦ E.g. aspect jars to use
Module POM
Defines all direct dependencies
◦ Do not rely on transitive dependencies
◦ Use scopes when applicable
◦
◦
◦
◦

Compile
Runtime (e.g. JDBC Drivers)
Test (e.g. JUnit, DBUnit)
Provided (e.g. Java EE jars)
Maven release plugin
mvn release:prepare release:perform

◦ Verifies if you checked in everything
◦ Verifies if you have SNAPSHOT dependencies
◦ outside the current released modules

◦ Tries to build and test your modules
◦ Updates the version to the release version and tags it in SCM
◦ Recursively

◦ Checks out the tagged version and build and deploys the release version
◦ Updates the version to the next SNAPSHOT version and checks it in
◦ Recursively
Maven release plugin prerequisites
<distributionManagement>
◦ in godfather POM
◦ point to repository server (nexus)

<server> with login for repository
◦ authorized to deploy
◦ in settings.xml

<scm> tag
◦ Point to subversion/git/CVS
Version Management in Maven
Demo1
Command line release cascade

Jenkins demo
What to Version / What to release
Could be: Individual Modules, Applications, Application System?
Depends on the lifecycle of your product
◦ Do you want to deploy/upgrade a single module or application?
◦ Can you test a single module?
◦ Can you test an application without testing the rest of the application system?
◦ Can you trace bugs in one application without knowing what other applications are running?
What if…
you release individual modules
Every module can have its own version
Maintenance releases with individual modules
◦ Dependants can stick to release versions if they want
◦ For big refactorings you need snapshot dependencies

Need big cascaded release to build a new version
What if…
you version an application system
Only one version to manage
Release all at once
Every change need a full release
Mix and match
Release some individual modules
◦ Those that are used in multiple applications

Release some applications as a whole
◦ Applications in maintenance

Release some application systems
◦ With strong intra-application dependencies
More interesting plugins
http://maven.apache.org/plugins/index.html

maven-help-plugin
◦ mvn help:effective-pom

maven-dependency-plugin
◦ mvn dependency:tree
◦ mvn dependency:analyze
◦ mvn dependency:analyze-dep-mgmt

maven-versions-plugin
◦ mvn versions:use-next-snapshots -DexcludeReactor=false -Dincludes=group:*
◦ mvn versions:update-child-modules
Demo2
maven-help-plugin

maven-dependency-plugin

maven-versions-plugin
Questions
Ad

More Related Content

What's hot (20)

Git undo
Git undoGit undo
Git undo
Avilay Parekh
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
Joao Pereira
 
Storage Management using LVM
Storage Management using LVMStorage Management using LVM
Storage Management using LVM
Priyank Kapadia
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Robert McDermott
 
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
OpenStack Korea Community
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
FastConnect
 
debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch
어형 이
 
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
OpenStack Korea Community
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Open Source Consulting
 
Jboss Tutorial Basics
Jboss Tutorial BasicsJboss Tutorial Basics
Jboss Tutorial Basics
Anandraj Kulkarni
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An Introduction
Juan A. Suárez Romero
 
[락플레이스] RHEL8.4 웨비나 발표자료
[락플레이스] RHEL8.4 웨비나 발표자료 [락플레이스] RHEL8.4 웨비나 발표자료
[락플레이스] RHEL8.4 웨비나 발표자료
rockplace
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
Ji-Woong Choi
 
Master the Monorepo
Master the MonorepoMaster the Monorepo
Master the Monorepo
Roman Minchyn
 
VMware Site Recovery Manager
VMware Site Recovery ManagerVMware Site Recovery Manager
VMware Site Recovery Manager
Jürgen Ambrosi
 
Jenkins
JenkinsJenkins
Jenkins
Roger Xia
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Jenkins
JenkinsJenkins
Jenkins
penetration Tester
 
CI/CD
CI/CDCI/CD
CI/CD
AmitDhodi
 
Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement Continue
Vincent Composieux
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
Joao Pereira
 
Storage Management using LVM
Storage Management using LVMStorage Management using LVM
Storage Management using LVM
Priyank Kapadia
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Robert McDermott
 
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
[OpenStack Days Korea 2016] Track3 - 오픈스택 환경에서 공유 파일 시스템 구현하기: 마닐라(Manila) 프로젝트
OpenStack Korea Community
 
debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch
어형 이
 
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
OpenStack Korea Community
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Open Source Consulting
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An Introduction
Juan A. Suárez Romero
 
[락플레이스] RHEL8.4 웨비나 발표자료
[락플레이스] RHEL8.4 웨비나 발표자료 [락플레이스] RHEL8.4 웨비나 발표자료
[락플레이스] RHEL8.4 웨비나 발표자료
rockplace
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
Ji-Woong Choi
 
VMware Site Recovery Manager
VMware Site Recovery ManagerVMware Site Recovery Manager
VMware Site Recovery Manager
Jürgen Ambrosi
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement Continue
Vincent Composieux
 

Similar to Version Management in Maven (20)

Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
Dan Hinojosa
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Control
ceardach
 
Agile Software Development & Tools
Agile Software Development & ToolsAgile Software Development & Tools
Agile Software Development & Tools
Luismi Amorós Martínez
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
Ori Donner
 
Maven
MavenMaven
Maven
Марія Русин
 
Build server
Build serverBuild server
Build server
Christophe Vanlancker
 
A-Z_Maven.pdf
A-Z_Maven.pdfA-Z_Maven.pdf
A-Z_Maven.pdf
Mithilesh Singh
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentation
Arnaud Héritier
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Gourav Varma
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
AnkurSingh656748
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0
Jasmine Conseil
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
venkata20k
 
Java is evolving rapidly: Maven helps you staying on track
Java is evolving rapidly:  Maven helps you staying on trackJava is evolving rapidly:  Maven helps you staying on track
Java is evolving rapidly: Maven helps you staying on track
Arnaud Héritier
 
Session 2
Session 2Session 2
Session 2
gayathiry
 
Session 2
Session 2Session 2
Session 2
gayathiry
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
Sumit Arora
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
Mangesh Bhujbal
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
DevOps presentation
DevOps presentationDevOps presentation
DevOps presentation
Axsh Co. LTD
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
Dan Hinojosa
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Control
ceardach
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
Ori Donner
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentation
Arnaud Héritier
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Gourav Varma
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0
Jasmine Conseil
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
venkata20k
 
Java is evolving rapidly: Maven helps you staying on track
Java is evolving rapidly:  Maven helps you staying on trackJava is evolving rapidly:  Maven helps you staying on track
Java is evolving rapidly: Maven helps you staying on track
Arnaud Héritier
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
Sumit Arora
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
Mangesh Bhujbal
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
DevOps presentation
DevOps presentationDevOps presentation
DevOps presentation
Axsh Co. LTD
 
Ad

More from Geert Pante (11)

OAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring BootOAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring Boot
Geert Pante
 
Kafka Introduction.pptx
Kafka Introduction.pptxKafka Introduction.pptx
Kafka Introduction.pptx
Geert Pante
 
Kubernetes and Amazon ECS
Kubernetes and Amazon ECSKubernetes and Amazon ECS
Kubernetes and Amazon ECS
Geert Pante
 
Docker in practice
Docker in practiceDocker in practice
Docker in practice
Geert Pante
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQ
Geert Pante
 
Log management with ELK
Log management with ELKLog management with ELK
Log management with ELK
Geert Pante
 
Java EE 6
Java EE 6Java EE 6
Java EE 6
Geert Pante
 
Spring 4 en spring data
Spring 4 en spring dataSpring 4 en spring data
Spring 4 en spring data
Geert Pante
 
Spring and SOA (2006)
Spring and SOA (2006)Spring and SOA (2006)
Spring and SOA (2006)
Geert Pante
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
Geert Pante
 
The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS
The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRISThe glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS
The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS
Geert Pante
 
OAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring BootOAuth2 and OpenID with Spring Boot
OAuth2 and OpenID with Spring Boot
Geert Pante
 
Kafka Introduction.pptx
Kafka Introduction.pptxKafka Introduction.pptx
Kafka Introduction.pptx
Geert Pante
 
Kubernetes and Amazon ECS
Kubernetes and Amazon ECSKubernetes and Amazon ECS
Kubernetes and Amazon ECS
Geert Pante
 
Docker in practice
Docker in practiceDocker in practice
Docker in practice
Geert Pante
 
Spring JMS and ActiveMQ
Spring JMS and ActiveMQSpring JMS and ActiveMQ
Spring JMS and ActiveMQ
Geert Pante
 
Log management with ELK
Log management with ELKLog management with ELK
Log management with ELK
Geert Pante
 
Spring 4 en spring data
Spring 4 en spring dataSpring 4 en spring data
Spring 4 en spring data
Geert Pante
 
Spring and SOA (2006)
Spring and SOA (2006)Spring and SOA (2006)
Spring and SOA (2006)
Geert Pante
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
Geert Pante
 
The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS
The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRISThe glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS
The glory of REST in Java: Spring HATEOAS, RAML, Temenos IRIS
Geert Pante
 
Ad

Recently uploaded (20)

What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 

Version Management in Maven

  • 1. Version Mgmt in Maven SOME BEST PRACTICES
  • 2. Agenda What is software versioning How can maven help us? ◦ Maven release plugin Best practices ◦ What to version? ◦ How to manage versions? Tips and tricks ◦ Version handling with maven-versions-plugin ◦ Dependency analysis with maven-dependency-plugin
  • 3. Version identifies software artefacts: Software Versioning ◦ modules, applications, assemblies, … ◦ Uniquely identifies source code ◦ Build should be repeatable from that version of code Most used: ◦ Major.minor[.bugfix][-qualifier[-build]] Qualifiers: ◦ ◦ ◦ ◦ ◦ Alpha: not feature complete Beta: contains critical bugs CR: release candidate, not fully tested Final: final version SNAPSHOT ◦ Floating version, not an actual identification ◦ Should allways be used for code under development
  • 4. Versioning with Source Code Management Basics of SCM (Git, Subversion, CVS, …) ◦ Synching software changes between developers ◦ Allowing multiple branches to be developed simultaneously ◦ Maintenance branches ◦ Feature branches ◦ Merge branches again  ◦ Tagging versions of code ◦ So you can find out later which bugs you solved when SCM does not put a version number in your artifacts!
  • 6. Maven in a nutshell
  • 7. Maven Basics Convention over configuration ◦ Convention for source code organization ◦ src/main/java ◦ src/webapp ◦ src/test/java ◦ Plugins with default configurations ◦ Jar, war, ear ◦ Surefire tests ◦ Reporting Dependency Management ◦ Remote repository and local repository ◦ Transactional dependencies
  • 8. Snapshots In maven, versions under development have classifier ‘-SNAPSHOT’ ◦ When building versions on a development system, you should always build SNAPSHOTS. ◦ When depending on a SNAPSHOT version of another module, maven will give you the latest (timestamped) version ◦ Could give surprises of code that suddenly stops building ◦ Preferrably have the source code of your SNAPSHOT dependencies built locally Non SNAPSHOT versions should be built only once and deployed once ◦ Should be tagged in Subversion/Git/CVS, and never changed ◦ (Unless you know for sure nobody got a copy yet) ◦ Released versions should never have SNAPSHOT dependencies ◦ See release plugin later
  • 9. Organizing Maven Modules Aggregator POM vs. Parent POM ◦ Aggregator POM organizes build of multiple modules ◦ One per subfolder ◦ Declares which subfolders contain modules ◦ Parent POM centralizes common configuration ◦ Plugin configuration ◦ Dependencies ◦ Dependency Management Convention: Aggregator POM == Parent POM ◦ Exceptions are allowed
  • 10. Typical Maven Workspace Hierarchy Workspace POM ◦ Godfather aka archon (development team) ◦ Application System(s) (set of related applications) ◦ Application or Library ◦ Module Group(s) (if necessary) ◦ Module
  • 11. Workspace POM Dummy Aggregator POM Just to launch other POM’s Can use symbolic links to point to actual application roots to be built.
  • 12. Godfather POM Defines <distributionManagement> and <repositories> ◦ <distributionManagement>: where your artifacts are deployed ◦ <repositories>: where other necessary artifacts can be found Rarely changes ◦ Simple fixed version number, e.g. 1, 2, 3, … Do not put shared dependencies here ◦ Use maven import (since maven 2.0.9)
  • 13. Application System POM Inherits from Godfather Defines external dependency versions in <dependencyManagement> Defines common plugin configuration ◦ E.g. java compiler version Could build an assembly containing all applications
  • 14. Application or Library POM Module groups Defines internal dependency management ◦ Sibling modules ◦ Can use ${project.version} Define more shared configuration ◦ Inapplicable on a higher level ◦ E.g. aspect jars to use
  • 15. Module POM Defines all direct dependencies ◦ Do not rely on transitive dependencies ◦ Use scopes when applicable ◦ ◦ ◦ ◦ Compile Runtime (e.g. JDBC Drivers) Test (e.g. JUnit, DBUnit) Provided (e.g. Java EE jars)
  • 16. Maven release plugin mvn release:prepare release:perform ◦ Verifies if you checked in everything ◦ Verifies if you have SNAPSHOT dependencies ◦ outside the current released modules ◦ Tries to build and test your modules ◦ Updates the version to the release version and tags it in SCM ◦ Recursively ◦ Checks out the tagged version and build and deploys the release version ◦ Updates the version to the next SNAPSHOT version and checks it in ◦ Recursively
  • 17. Maven release plugin prerequisites <distributionManagement> ◦ in godfather POM ◦ point to repository server (nexus) <server> with login for repository ◦ authorized to deploy ◦ in settings.xml <scm> tag ◦ Point to subversion/git/CVS
  • 19. Demo1 Command line release cascade Jenkins demo
  • 20. What to Version / What to release Could be: Individual Modules, Applications, Application System? Depends on the lifecycle of your product ◦ Do you want to deploy/upgrade a single module or application? ◦ Can you test a single module? ◦ Can you test an application without testing the rest of the application system? ◦ Can you trace bugs in one application without knowing what other applications are running?
  • 21. What if… you release individual modules Every module can have its own version Maintenance releases with individual modules ◦ Dependants can stick to release versions if they want ◦ For big refactorings you need snapshot dependencies Need big cascaded release to build a new version
  • 22. What if… you version an application system Only one version to manage Release all at once Every change need a full release
  • 23. Mix and match Release some individual modules ◦ Those that are used in multiple applications Release some applications as a whole ◦ Applications in maintenance Release some application systems ◦ With strong intra-application dependencies
  • 24. More interesting plugins http://maven.apache.org/plugins/index.html maven-help-plugin ◦ mvn help:effective-pom maven-dependency-plugin ◦ mvn dependency:tree ◦ mvn dependency:analyze ◦ mvn dependency:analyze-dep-mgmt maven-versions-plugin ◦ mvn versions:use-next-snapshots -DexcludeReactor=false -Dincludes=group:* ◦ mvn versions:update-child-modules