# commsen/bom-helper-maven-plugin architecture

> Architecture diagram of the GitHub repository commsen/bom-helper-maven-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/commsen/bom-helper-maven-plugin
- Repository: https://github.com/commsen/bom-helper-maven-plugin

## Overview

This repository is a Maven plugin for managing dependency-management BOM entries. A Maven build invokes one of three goals: scan local JARs to add Maven coordinates, sort existing BOM entries, or resolve managed artifacts. The two editing goals write an updated POM, optionally in place with a backup. Shared code supplies Maven project/session context and POM output; `Gav` represents coordinates used by scanning and sorting. The README is empty, so capabilities and relationships here are based on the sampled goal implementations and their annotations.

Main entry points: [`src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java`](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java) (Scan JARs), [`src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java`](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java) (Sort BOM), [`src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java`](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java) (Resolve BOM), [`src/main/java/com/commsen/maven/plugin/bomhelper/Gav.java`](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/Gav.java) (GAV coordinates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_goals["Maven goals"]
  node_from_jars["Scan JARs"]
  node_sort_bom["Sort BOM<br/>[BomSortMojo.java]"]
end

subgraph group_shared["Shared BOM logic"]
  node_coordinates["GAV coordinates<br/>[Gav.java]"]
  node_pom_writer["POM writer"]
  node_maven_context["Maven context"]
end

subgraph group_resolution["Artifact resolution"]
  node_resolve_bom["Resolve BOM"]
end

node_maven(("Maven build"))
node_project_pom["Project POM"]
node_artifact_resolver["Artifact resolver"]
node_remote_repositories[("Remote repositories")]

node_maven -->|"invokes goal"| node_from_jars
node_maven -->|"invokes goal"| node_sort_bom
node_maven -->|"invokes goal"| node_resolve_bom
node_from_jars -->|"constructs coordinates"| node_coordinates
node_from_jars -->|"saves POM"| node_pom_writer
node_sort_bom -->|"sorts by GAV"| node_coordinates
node_sort_bom -->|"saves POM"| node_pom_writer
node_resolve_bom -->|"resolves artifacts"| node_artifact_resolver
node_resolve_bom -->|"configures search"| node_remote_repositories
node_from_jars -->|"reads and updates"| node_project_pom
node_sort_bom -->|"reads and updates"| node_project_pom
node_resolve_bom -->|"reads dependencies"| node_project_pom

click node_from_jars "https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java"
click node_sort_bom "https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java"
click node_resolve_bom "https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java"
click node_coordinates "https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/Gav.java"
click node_pom_writer "https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/PomChangingAbstractMojo.java"
click node_maven_context "https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomHelperAbstractMojo.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_from_jars,node_sort_bom toneBlue
class node_coordinates,node_pom_writer,node_maven_context,node_remote_repositories toneAmber
class node_resolve_bom toneMint
class node_maven,node_project_pom,node_artifact_resolver toneIndigo
```

## Components

### Maven goals

- [Scan JARs](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java): `src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java`
- [Sort BOM](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java): `src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java`

### Shared BOM logic

- [GAV coordinates](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/Gav.java): `src/main/java/com/commsen/maven/plugin/bomhelper/Gav.java`
- [POM writer](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/PomChangingAbstractMojo.java): `src/main/java/com/commsen/maven/plugin/bomhelper/PomChangingAbstractMojo.java`
- [Maven context](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomHelperAbstractMojo.java): `src/main/java/com/commsen/maven/plugin/bomhelper/BomHelperAbstractMojo.java`

### Artifact resolution

- [Resolve BOM](https://github.com/commsen/bom-helper-maven-plugin/blob/master/src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java): `src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java`

### Other components

- **Maven build**
- **Project POM**
- **Artifact resolver**
- **Remote repositories**

## Connections

- Maven build → Scan JARs: invokes goal (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java`)
- Maven build → Sort BOM: invokes goal (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java`)
- Maven build → Resolve BOM: invokes goal (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java`)
- Scan JARs → GAV coordinates: constructs coordinates (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java`)
- Scan JARs → POM writer: saves POM (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java`)
- Sort BOM → GAV coordinates: sorts by GAV (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java`)
- Sort BOM → POM writer: saves POM (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java`)
- Resolve BOM → Artifact resolver: resolves artifacts (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java`)
- Resolve BOM → Remote repositories: configures search (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java`)
- Scan JARs → Project POM: reads and updates (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomFromJarsMojo.java`)
- Sort BOM → Project POM: reads and updates (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomSortMojo.java`)
- Resolve BOM → Project POM: reads dependencies (evidence: `src/main/java/com/commsen/maven/plugin/bomhelper/BomResolveMojo.java`)
