SlideShare a Scribd company logo
1 of 18
System Architecture
      using Maven Modularity
Tibor Digaňa
Github repository
https://github.com/Tibor17/maven/tree/master/architecture/modularity
Goal
• To split product modularity to 3 logical parts
• Dependencies Management
• Run out of the hell of duplicate and
  conflicting versions
Agenda
•   Explanatory picture
•   Dependency Management in Maven
•   Product’s projects (Maven)
•   Internal projects (Maven)
•   External artifacts (Maven)
Three Parts of Architecture
• Maven projects of a product
• Maven artifacts of internal projects
• Maven external artifacts - repository
Maven Dependency Management
splits to three Build Of Material POMs
• Product’s dependencyManagement located in
  com.xyz:product-bom:pom:1.0.0
• Internal projects dependencyManagement
  located in
  com.xyz:internal-bundles-bom:pom:1.0.0
• External artifacts (in a repository)
  dependencyManagement located in
  com.xyz:external-bundles-bom:pom:1.0.0
Explanatory Picture
Product’s Projects
• See the previous picture, artifacts namely:
  com.xyz:product-bundle-3:jar:1.0.0
  com.xyz:product-bundle-2:jar:1.0.0
  com.xyz:product-bundle-1:jar:1.0.0
• extend from POM
  com.xyz:product-bom:pom:1.0.0
  which has only dependencyManagement
  and specifies product Maven modules namely
  product-bundle-3
  product-bundle-2
  product-bundle-1
Internal Projects
• See the previous picture, artifacts namely:
  com.xyz:internal-bundle-1:jar:1.0.0
  com.xyz:internal-bundle-2:jar:1.0.0
  com.xyz:internal-bundle-3:jar:1.0.0
• extend from POM
  com.xyz:internal-bundles-bom:pom:1.0.0
  which has only dependencyManagement
  and specifies product Maven modules namely
  internal-bundle-1
  internal-bundle-2
  internal-bundle-3
External Artifacts
• No projects with sources
• Only repositories with deployed open source
  artifacts
• Only POM with dependencyManagement e.g.:
Common BOM’s parent
All three BOM projects have common parent; e.g.:
<parent>
     <groupId>com.xyz</groupId>
     <artifactId>modularity</artifactId>
     <version>1.0.0</version>
</parent>
The parent is important to compile all from scratch.
com.xyz:product-bom:pom:1.0.0
com.xyz:product-bom:pom:1.0.0
The project does not validate by itself because new
internal-bundles-bom does not exist in repository.
Therefore deploy with new expected versions:
1. First alternative
  –   Physically deploy external bundles to your repository
  –   Using external-bundles-bom: mvn deploy
  –   Using internal-bundles-bom: mvn deploy
  –   Deploy product using product-bom: mvn deploy
2. Second alternative, use the top parent with new
   children versions:
  –   Simply deploy using top parent com.xyz:modularity:1.0.0
com.xyz:internal-bundles-bom:pom:1.0.0
com.xyz:internal-bundles-bom:pom:1.0.0

In order to deploy internal bundles:
• Prepare repository with external artifacts
• Resolve conflicts on external artifacts
Resolve conflicting versions
• Exclusions applied only to external artifacts.
• Conflicts are resolved by increased version
  (except for major version)
Example of resolving conflicts on
       external bundles
com.xyz:external-bundles-bom:pom:1.0.0
Dependency Management Violation
• </dependencyManagement> declares
  dependencies by POM packaging project
• </dependencies> uses artifacts in children
• Properties specifying artifacts versions violate
  the whole idea of dependencyManagement

See the link (project with <artifactId>bom</artifactId>)
http://maven.apache.org/guides/introduction/introduction-to-
   dependency-mechanism.html#Importing_Dependencies
Thank you!


                    Download Sources
https://github.com/Tibor17/maven/tree/master/architecture/modularity

More Related Content

What's hot

(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to MavenEric Wyles
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven Ankit Gubrani
 
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 MavenGeert Pante
 
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevTriple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevWerner Keil
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in MavenGeert Pante
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenAlan Parkinson
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsJohn Ferguson Smart Limited
 
Embrace Maven
Embrace MavenEmbrace Maven
Embrace MavenGuy Marom
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenPaul Withers
 
YaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promisesYaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promisesArnaud Héritier
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCUlrich Krause
 

What's hot (20)

Maven tutorial for beginners
Maven tutorial for beginnersMaven tutorial for beginners
Maven tutorial for beginners
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Build Automation using Maven
Build Automation using Maven Build Automation using Maven
Build Automation using Maven
 
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
 
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevTriple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
 
Maven
MavenMaven
Maven
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in Maven
 
Jenkins
JenkinsJenkins
Jenkins
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
 
Maven
MavenMaven
Maven
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yards
 
Embrace Maven
Embrace MavenEmbrace Maven
Embrace Maven
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
 
YaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promisesYaJUG-Maven 3.x, will it lives up to its promises
YaJUG-Maven 3.x, will it lives up to its promises
 
MWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVCMWLUG 2015 - An Introduction to MVC
MWLUG 2015 - An Introduction to MVC
 

Similar to Maven Modularity System Architecture

Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentationArnaud Héritier
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The FactLuciano Resende
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenArnaud Héritier
 
Composing Project Dependencies
Composing Project DependenciesComposing Project Dependencies
Composing Project DependenciesDerek Gallo
 
Intro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsIntro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsManuel Carrasco Moñino
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoftvenkata20k
 
Java build tools
Java build toolsJava build tools
Java build toolsSujit Kumar
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 
Introduction in Apache Maven2
Introduction in Apache Maven2Introduction in Apache Maven2
Introduction in Apache Maven2Heiko Scherrer
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.Fazreil Amreen Abdul Jalil
 

Similar to Maven Modularity System Architecture (20)

Maven
MavenMaven
Maven
 
A-Z_Maven.pdf
A-Z_Maven.pdfA-Z_Maven.pdf
A-Z_Maven.pdf
 
Maven
MavenMaven
Maven
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
Mavenized RCP
Mavenized RCPMavenized RCP
Mavenized RCP
 
Tuscany : Applying OSGi After The Fact
Tuscany : Applying  OSGi After The FactTuscany : Applying  OSGi After The Fact
Tuscany : Applying OSGi After The Fact
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
 
Composing Project Dependencies
Composing Project DependenciesComposing Project Dependencies
Composing Project Dependencies
 
Intro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin ElementsIntro to Web Components, Polymer & Vaadin Elements
Intro to Web Components, Polymer & Vaadin Elements
 
Apache Maven 2 Part 2
Apache Maven 2 Part 2Apache Maven 2 Part 2
Apache Maven 2 Part 2
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
 
Maven
MavenMaven
Maven
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Java build tools
Java build toolsJava build tools
Java build tools
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Introduction in Apache Maven2
Introduction in Apache Maven2Introduction in Apache Maven2
Introduction in Apache Maven2
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.
 
Exploring Maven SVN GIT
Exploring Maven SVN GITExploring Maven SVN GIT
Exploring Maven SVN GIT
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Maven Modularity System Architecture

  • 1. System Architecture using Maven Modularity Tibor Digaňa Github repository https://github.com/Tibor17/maven/tree/master/architecture/modularity
  • 2. Goal • To split product modularity to 3 logical parts • Dependencies Management • Run out of the hell of duplicate and conflicting versions
  • 3. Agenda • Explanatory picture • Dependency Management in Maven • Product’s projects (Maven) • Internal projects (Maven) • External artifacts (Maven)
  • 4. Three Parts of Architecture • Maven projects of a product • Maven artifacts of internal projects • Maven external artifacts - repository
  • 5. Maven Dependency Management splits to three Build Of Material POMs • Product’s dependencyManagement located in com.xyz:product-bom:pom:1.0.0 • Internal projects dependencyManagement located in com.xyz:internal-bundles-bom:pom:1.0.0 • External artifacts (in a repository) dependencyManagement located in com.xyz:external-bundles-bom:pom:1.0.0
  • 7. Product’s Projects • See the previous picture, artifacts namely: com.xyz:product-bundle-3:jar:1.0.0 com.xyz:product-bundle-2:jar:1.0.0 com.xyz:product-bundle-1:jar:1.0.0 • extend from POM com.xyz:product-bom:pom:1.0.0 which has only dependencyManagement and specifies product Maven modules namely product-bundle-3 product-bundle-2 product-bundle-1
  • 8. Internal Projects • See the previous picture, artifacts namely: com.xyz:internal-bundle-1:jar:1.0.0 com.xyz:internal-bundle-2:jar:1.0.0 com.xyz:internal-bundle-3:jar:1.0.0 • extend from POM com.xyz:internal-bundles-bom:pom:1.0.0 which has only dependencyManagement and specifies product Maven modules namely internal-bundle-1 internal-bundle-2 internal-bundle-3
  • 9. External Artifacts • No projects with sources • Only repositories with deployed open source artifacts • Only POM with dependencyManagement e.g.:
  • 10. Common BOM’s parent All three BOM projects have common parent; e.g.: <parent> <groupId>com.xyz</groupId> <artifactId>modularity</artifactId> <version>1.0.0</version> </parent> The parent is important to compile all from scratch.
  • 12. com.xyz:product-bom:pom:1.0.0 The project does not validate by itself because new internal-bundles-bom does not exist in repository. Therefore deploy with new expected versions: 1. First alternative – Physically deploy external bundles to your repository – Using external-bundles-bom: mvn deploy – Using internal-bundles-bom: mvn deploy – Deploy product using product-bom: mvn deploy 2. Second alternative, use the top parent with new children versions: – Simply deploy using top parent com.xyz:modularity:1.0.0
  • 14. com.xyz:internal-bundles-bom:pom:1.0.0 In order to deploy internal bundles: • Prepare repository with external artifacts • Resolve conflicts on external artifacts
  • 15. Resolve conflicting versions • Exclusions applied only to external artifacts. • Conflicts are resolved by increased version (except for major version)
  • 16. Example of resolving conflicts on external bundles com.xyz:external-bundles-bom:pom:1.0.0
  • 17. Dependency Management Violation • </dependencyManagement> declares dependencies by POM packaging project • </dependencies> uses artifacts in children • Properties specifying artifacts versions violate the whole idea of dependencyManagement See the link (project with <artifactId>bom</artifactId>) http://maven.apache.org/guides/introduction/introduction-to- dependency-mechanism.html#Importing_Dependencies
  • 18. Thank you! Download Sources https://github.com/Tibor17/maven/tree/master/architecture/modularity