# deviceinsight/helm-maven-plugin architecture

> Architecture diagram of the GitHub repository deviceinsight/helm-maven-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deviceinsight/helm-maven-plugin
- Repository: https://github.com/deviceinsight/helm-maven-plugin

## Overview

##### Main Components
- Maven Plugin Core: Represent the overall plugin container that is invoked during a Maven build.
– Package Mojo (AbstractHelmMojo, PackageMojo)
– Lint Mojo (LintMojo)
– Template Mojo (TemplateMojo)
– Deploy Mojo (DeployMojo)
- Utility Helpers: Include components for auxiliary functionality such as:
– PropertyReplacement (with exclusion handling)
– PlatformDetector (to handle OS/platform-specific logic)
– ServerAuthentication (for Helm repository credentials)
- External Dependencies:
– Helm Binary: An external tool that is either downloaded (using the wrapper configurations) or executed to perform helm commands.
– Helm Repository (e.g., ChartMuseum): The external system where charts are deployed or deleted.
- Configuration/Properties: A component representing the Maven configuration (read from pom.xml) that drives all operation details (chart name, helm version, repo URLs, etc.).

##### Relationships and Data Flow
- That the Maven build process provides input (via pom.xml configuration) to the Helm Maven Plugin.
– Package Mojo invokes “helm package” with the appropriate chart directory.
– Lint Mojo invokes “helm lint” (and optionally, strict linting is configured).
– Template Mojo invokes “helm template” to locally render chart templates.
– Deploy Mojo manages the upload of the packaged chart to the configured Helm repository.
- That utility helper components (such as PropertyReplacement) are utilized by relevant mojos to process the chart files before handing them off to the helm commands.
- That external communications (HTTP calls) occur when deploying (or possibly deleting previous chart versions), connecting to a remote Helm repository.

##### Architectural Patterns
- Separation of Concerns: Each Maven goal is encapsulated into its own Mojo class.
- External Integration: Clear delineation between the plugin’s internal processes and external tools (helm binary, remote chart repos).
- Configuration Driven: Demonstrate that the system is driven entirely by Maven properties and configurations (as detailed in the README’s configuration table).

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Maven Build (pom.xml)"]:::config
    B["Helm Maven Plugin Core"]:::plugin

    subgraph "Mojo Implementations"
        B1["AbstractHelmMojo"]:::mojo
        B2["PackageMojo"]:::mojo
        C["LintMojo"]:::mojo
        D["TemplateMojo"]:::mojo
        E["DeployMojo"]:::mojo
    end

    subgraph "Utility Helpers"
        F["Property Replacement"]:::utility
        G["Platform Detector"]:::utility
        H["Server Authentication"]:::utility
    end

    subgraph "External Dependencies"
        I["Helm Binary"]:::external
        J["Helm Repository (ChartMuseum)"]:::external
    end

    A -->|"configures"| B
    B -->|"invokes"| B1
    B -->|"invokes"| B2
    B -->|"invokes"| C
    B -->|"invokes"| D
    B -->|"invokes"| E

    B1 ---|"uses"| F
    B2 ---|"uses"| F
    C ---|"uses"| F
    D ---|"uses"| F
    E ---|"uses"| F

    B ---|"detects-platform"| G
    B ---|"handles-auth"| H

    B1 -->|"runs-helm_package"| I
    B2 -->|"runs-helm_package"| I
    C -->|"runs-helm_lint"| I
    D -->|"runs-helm_template"| I
    E -->|"deploys-viaHTTP"| J

    click A "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/pom.xml"
    click B "https://github.com/deviceinsight/helm-maven-plugin/tree/develop/src/main/kotlin/com/deviceinsight/helm"
    click B1 "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/AbstractHelmMojo.kt"
    click B2 "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/PackageMojo.kt"
    click C "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/LintMojo.kt"
    click D "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/TemplateMojo.kt"
    click E "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt"
    click F "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/PropertyReplacement.kt"
    click G "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/util/PlatformDetector.kt"
    click H "https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/util/ServerAuthentication.kt"

    classDef config fill:#ffebcd,stroke:#333,stroke-width:2px;
    classDef plugin fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef mojo fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef utility fill:#fffacd,stroke:#333,stroke-width:2px;
    classDef external fill:#ffcccb,stroke:#333,stroke-width:2px;
```
