How deviceinsight/helm-maven-plugin works
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).