Giter Club home page Giter Club logo

helm-maven-plugin's Introduction

Helm Maven Plugin

Java CI with Maven

A Maven plugin that makes Maven properties available in your Helm Charts. It can be used to automatically package your Helm Chart, render it and upload it to a Helm repository like ChartMuseum.

Usage

Add the following to your pom.xml

<build>
  <plugins>
    ...
    <plugin>
      <groupId>com.deviceinsight.helm</groupId>
      <artifactId>helm-maven-plugin</artifactId>
      <version>2.11.1</version>
      <configuration>
        <chartName>my-chart</chartName>
        <chartRepoUrl>https://charts.helm.sh/stable</chartRepoUrl>
        <helmVersion>3.11.1</helmVersion>
        <strictLint>true</strictLint>
        <valuesFile>src/test/helm/my-chart/values.yaml</valuesFile>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>package</goal>
            <goal>lint</goal>
            <goal>template</goal>
            <goal>deploy</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

In the same Maven module, put your helm charts into src/main/helm/<chartName>. In the Chart.yaml, you can use the ${artifactId}, ${project.version}, and ${project.name} Maven placeholders. You can also use Maven properties.

An example for a Chart.yaml is:

apiVersion: v1
description: A Helm chart installing Rubicon
name: ${artifactId}
version: ${project.version}
home: https://gitlab.device-insight.com/deviceinsight/rubicon
maintainers:
  - name: Device Insight
    url: https://www.device-insight.com

You probably also will adjust the templates/deployment.yaml so that the correct docker image is used. An example snippet:

[...]
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}/rubicon:${project.version}"
[...]

Configuration

Property Default Description
chartName The Maven artifactId The name of the chart
chartVersion ${project.model.version} The version of the chart
chartRepoUrl null The URL of the Chart repository where dependencies are required from and where charts should be published to
incubatorRepoUrl https://charts.helm.sh/incubator The URL to the incubator Chart repository
addIncubatorRepo true Whether the repository defined in incubatorRepoUrl should be added when running the package goal
forceAddRepos false Whether to overwrite the repository configuration when adding a new repository with the same name. This flag is only relevant when using Helm 3 and emulates Helm 2 behavior
chartPublishUrl ${chartRepoUrl}/api/charts The URL that will be used for publishing the chart. The default value will work if chartRepoUrl refers to a ChartMuseum.
chartPublishMethod "POST" The HTTP method that will be used for publishing requests
chartDeleteUrl ${chartRepoUrl}/api/charts/${chartName}/${chartVersion} The URL that will be used for deleting a previous version of the chart. This is used for updating SNAPSHOT versions. The default value will work if chartRepoUrl refers to a ChartMuseum.
chartRepoUsername None The username for basic authentication against the chart repo
chartRepoPassword None The password for basic authentication against the chart repo
chartRepoServerId None The ID of the server definition from the settings.xml server list to obtain the chart repo username/password from. If both chartRepoUsername/chartRepoPassword and chartRepoServerId are specified then the values specified in chartRepoUsername/chartRepoPassword take precedence.
chartFolder "src/main/helm/<chartName>" The location of the chart files (e.g. Chart.yaml).
skipSnapshots true If true, SNAPSHOT versions will be built, but not deployed.
helmGroupId "com.deviceinsight.helm" The helm binary groupId
helmArtifactId "helm" The helm binary artifactId
helmVersion None The helm binary version. (Make sure to use a recent helm binary version that doesn't use the old Helm Chart repositories from +https://kubernetes-charts.storage.googleapis.com+, >= 3.4.0 or >= 2.17.0 if you are still using Helm 2)
helmDownloadUrl "https://get.helm.sh/" The URL where the helm binary is downloaded from.
helm.skip false If true, execution will be skipped entirely
stableRepoUrl "https://charts.helm.sh/stable" For helm 2.x: Can be used to overwrite the default URL for stable repository during helm init
strictLint false If true, linting fails on warnings (see: Lint)
valuesFile None values file that should be used for goals Lint, Template
extraValuesFiles None a list of additional values files that can be generated dynamically and will be merged with the values.yaml during Package.
outputFile target/test-classes/helm.yaml output file for template goal
deployAtEnd false If true, the helm chart is deployed at the end of a multi-module Maven build. This option does not make sense for single-module Maven projects.
propertyReplacement Empty Structure to configure property replacement performed on the chart files
propertyReplacement.exclusions Empty List of file extensions that should be excluded from property replacement. The expressions are by default glob expressions

Goals

Package

Goal packages a chart directory into a chart archive using the helm package command.

Deploy

Goal publishes the packaged chart in the configured chart repository.

Lint

Goal examines a chart for possible issues using the helm lint command.

  • A values file can be provided via parameter valueFile
  • Strict linting can be configured via parameter strictLint

Template

goal locally renders templates using the helm template command.

  • A values file can be provided via parameter valueFile
  • An output file can be provided via parameter outputFile

Example

To use the deployAtEnd functionality it's mandatory to put the Helm Maven Plugin configuration in the parent pom.

<build>
  <plugins>
    ...
    <plugin>
      <groupId>com.deviceinsight.helm</groupId>
      <artifactId>helm-maven-plugin</artifactId>
      <version>2.14.0</version>
      <configuration>
        <chartName>my-chart</chartName>
        <chartRepoUrl>https://charts.helm.sh/stable</chartRepoUrl>
        <helmVersion>3.13.0</helmVersion>
        <strictLint>true</strictLint>
        <valuesFile>src/test/helm/my-chart/values.yaml</valuesFile>
        <deployAtEnd>true</deployAtEnd>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>package</goal>
            <goal>lint</goal>
            <goal>template</goal>
            <goal>deploy</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Exclude files from property replacement

To exclude files from property replacement, you can use the propertyReplacement configuration. Any exclusion matching will exclude the file from property replacement. By default, glob expressions are used. You can also use regular expressions by prefixing the expression with regex.

<build>
  <plugins>
    ...
    <plugin>
      <groupId>com.deviceinsight.helm</groupId>
      <artifactId>helm-maven-plugin</artifactId>
      <version>2.14.0</version>
      <configuration>
        <chartName>my-chart</chartName>
        <chartRepoUrl>https://charts.helm.sh/stable</chartRepoUrl>
        <helmVersion>3.13.0</helmVersion>
        <strictLint>true</strictLint>
        <valuesFile>src/test/helm/my-chart/values.yaml</valuesFile>
        <propertyReplacement>
            <exclusions>
                <exclusion>**/grafana-dashboards/**/*.json</exclusion>
                <exclusion>regex:.*/grafana-dashboards/.*\.json</exclusion>
            </exclusions>
        </propertyReplacement>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>package</goal>
            <goal>lint</goal>
            <goal>template</goal>
            <goal>deploy</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Troubleshooting

  1. Problem
    The following error message is a common source of trouble, lately:

    [ERROR] Output: Error: error initializing: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Failed to fetch https://kubernetes-charts.storage.googleapis.com/index.yaml : 403 Forbidden
    
    ...
    
    [ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.11.1:package (default) on project my-project: Error creating helm chart: When executing '/home/user/.m2/repository/com/deviceinsight/helm/helm/2.16.2/helm-2.16.2-linux-amd64.binary init --client-only' got result code '1' -> [Help 1]
    

    Solution
    This is likely due to an old version of helm itself. Make sure to configure <helmVersion> to a version >= 3.4.0 or, if you are still using Helm 2, a version >= 2.17.0 (background information).

  2. Problem
    The following error message appears if you use an old version of helm-maven-plugin:

    [ERROR] Output: Error: error initializing: Looks like "https://kubernetes-charts-incubator.storage.googleapis.com" is not a valid chart repository or cannot be reached: Failed to fetch https://kubernetes-charts-incubator.storage.googleapis.com/index.yaml : 403 Forbidden
    

    Solution
    This can be solved by upgrading helm-maven-plugin itself to version 2.7.0 or later (#67).

Releasing

Creating a new release involves the following steps:

  1. ./mvnw gitflow:release-start gitflow:release-finish
  2. git push origin master
  3. git push --tags
  4. git push origin develop

In order to deploy the release to Maven Central, you need to create an account at https://issues.sonatype.org and configure your account in ~/.m2/settings.xml:

<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>your-jira-id</username>
      <password>your-jira-pwd</password>
    </server>
  </servers>
</settings>

The account also needs access to the project on Maven Central. This can be requested by another project member.

Then check out the release you want to deploy (git checkout x.y.z) and run ./mvnw deploy -Prelease.

helm-maven-plugin's People

Contributors

chleij avatar d-rk avatar dependabot[bot] avatar ezienecker avatar heivo avatar hho avatar jonbrohauge avatar kobynet avatar marinabauer avatar mscibilia avatar mwalser avatar pvorb avatar sflandergan avatar stefan-hudelmaier avatar steven-sheehy avatar trnl avatar vladfau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helm-maven-plugin's Issues

Version of generated chart does not match version specified in Chart.yaml

When the plugin packages the chart it overrides the chart version from Chart.yaml with the project.model.version property. If the project version does not exactly conform to SemVer 2, (includes "-SNAPSHOT" for example) this causes several problems with Helm.

executeCmd("$helm package ${chartName()} --version ${project.model.version}")

Beyond the SemVer strictness, the Helm docs state that the version number in the chart name is assumed to match the one in Chart.yaml, and that "failure to meet this assumption will cause an error."

If anything, the project version should be used to set the appVersion Helm field, which versions the application included in the chart.

As it stands right now, a chart with a correctly set version in Chart.yaml but with a maven project version that does not meet Helm requirements will be packaged with the latter as its chart version and then will not be picked up by Helm CLI tooling.

Use `helm push` instead of direct upload

helm push is the native way for Helm 3 to upload artifacts. Using helm push allows helm-maven-plugin to support:

  • S3 repos (via helm-s3)
  • OCI repos (since helm 3.7.0)
  • ChartMuseum (via its plugin)
  • lots of other things...

Ubuntu arm 64 (aarch64) not supported

Error message:

Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating helm chart: Unsupported platform architecture 'aarch64'

This affects all versions of the plugin.

Attaching patch to fix this issue.
patch.zip

Invalid cookie header: "Set-Cookie: AWSALB=...”

helm-maven-plugin:2.4.1

When uploading helm chart to Chartmuseum behind AWS ALB, I am getting the flowing warnings:

WARNING: Invalid cookie header: "Set-Cookie: AWSALB=xxxxxxxxxxxxxxxxxxx; Expires=Tue, 18 Aug 2020 06:25:40 GMT; Path=/". Invalid 'expires' attribute: Tue, 18 Aug 2020 06:25:40 GMT

The helm chart is uploaded despite the warnings.

It would be nice to be able to disable the cookie header checks or fix the warnings. Thanks!

Support configuring multiple repositories

Currently, there's a somewhat random step in the PackageMojo that adds an incubator repository. #77 allows us to disable this step, which was necessary for a CI pipeline that is behind a very restrictive firewall that doesn't allow access to the publicly available incubator repository.

In the long term, it would be way nicer if we would not make any assumptions about incubator or regular repositories. We could just support configuring a list of repositories and their alias, as well as a separate repository for deploying/publishing a chart.

This could look similar to the following lines:

<configuration>
    <helmRepositories>
        <helmRepository>
            <name>myChartRepo</name>
            <url>https://example.github.io/chart-repo/</url>
            <!-- optionally with a way to specify credentials -->
        </helmRepository>
    </helmRepositories>

    <publishRepository>
        <url>https://example.com/helm</url>
        <method>PUT</method>
        <!-- optionally with a way to specify credentials -->
    </publishRepository>
</configuration>

Support to set helm options (e.g. --insecure)

Is it possible to add a generic way to pass options to the CLI call of helm?

I currently need a way to bypass certificate verification to access a project's chart repository. This can be done with one of the "--insecure" options, depending on what really needs to be done.

So adding just the handling of insecure would be fine, but adding a general way to just pass options is probably even more useful in the long run.

make plugin threadSafe

when I run mvn with args like -T 1C I can read warning like this

[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project      *
[WARNING] * contains the following plugin(s) that have goals not marked   *
[WARNING] * as @threadSafe to support parallel building.                  *
[WARNING] * While this /may/ work fine, please look for plugin updates    *
[WARNING] * and/or request plugins be made thread-safe.                   *
[WARNING] * If reporting an issue, report it against the plugin in        *
[WARNING] * question, not against maven-core                              *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadSafe in webservice:
[WARNING] com.deviceinsight.helm:helm-maven-plugin:2.10.0
[WARNING] Enable debug to see more precisely which goals are not marked @threadSafe.
[WARNING] *****************************************************************

Can you make sure that plugin is thread safe?

Add support for configuring the full upload URL

Add support for configuring the full upload URL.

Currently the upload URL is only partly configurable, namely via the chartRepoUrl parameter.
But the upload URL is the value of that parameter with the suffix /api/charts.

Source: https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/DeployMojo.kt

It would be nice if the full URL was configurable. Otherwise I must construct the post call via another plugin.

Fails packaging when binary files

If you vendor charts so that it already contains tgz files the plugin will attempt to process tgz files for property substitution. It should only substitute extensions (json|tpl|yaml|yml).

[INFO] Clear target directory to ensure clean target package
[INFO] Created target helm directory
[DEBUG] Processing helm files in directory /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/.DS_Store
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/.DS_Store
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/requirements.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/requirements.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/Chart.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/Chart.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/hedera-mirror-grpc-0.1.0.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/hedera-mirror-grpc-0.1.0.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/hedera-mirror-importer-0.1.0.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/hedera-mirror-importer-0.1.0.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/prometheus-adapter-2.3.1.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/prometheus-adapter-2.3.1.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/prometheus-operator-8.13.2.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/prometheus-operator-8.13.2.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/loki-stack-0.36.1.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/loki-stack-0.36.1.tgz
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Hedera Mirror Node 0.10.0-rc1:
[INFO]
[INFO] Hedera Mirror Node ................................. FAILURE [  0.278 s]
[INFO] Hedera Mirror Node Importer ........................ SKIPPED
[INFO] Hedera Mirror Node Coverage ........................ SKIPPED
[INFO] Hedera Mirror Data Generator ....................... SKIPPED
[INFO] Hedera Mirror Node Protobuf ........................ SKIPPED
[INFO] Hedera Mirror Node GRPC API ........................ SKIPPED
[INFO] Hedera Mirror Node REST API ........................ SKIPPED
[INFO] Hedera Mirror Node Test ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.170 s
[INFO] Finished at: 2020-05-01T09:17:54-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.5.0-SNAPSHOT:package (default-cli) on project hedera-mirror-node: Error creating helm chart: Could not resolve property: 'W��H�y���сR,��E���h�M�8&��@���vC2:�m��n����w%��ܷ�&�������' used in file: '/Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/loki-stack-0.36.1.tgz' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.5.0-SNAPSHOT:package (default-cli) on project hedera-mirror-node: Error creating helm chart: Could not resolve property: 'W��H�y���сR,��E���h�M�8&��@���vC2:�m��n����w%��ܷ�&�������' used in file: '/Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/loki-stack-0.36.1.tgz'
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating helm chart: Could not resolve property: 'W��H�y���сR,��E���h�M�8&��@���vC2:�m��n����w%��ܷ�&�������' used in file: '/Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/loki-stack-0.36.1.tgz'
    at com.deviceinsight.helm.PackageMojo.execute (PackageMojo.kt:94)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: java.lang.IllegalStateException: Could not resolve property: 'W��H�y���сR,��E���h�M�8&��@���vC2:�m��n����w%��ܷ�&�������' used in file: '/Users/steven/projects/hedera/hedera-mirror-node/target/helm/Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/loki-stack-0.36.1.tgz'
    at com.deviceinsight.helm.PackageMojo.findPropertyValue (PackageMojo.kt:155)
    at com.deviceinsight.helm.PackageMojo.access$findPropertyValue (PackageMojo.kt:29)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1$1.invoke (PackageMojo.kt:126)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1$1.invoke (PackageMojo.kt:29)
    at kotlin.text.Regex.replace (Regex.kt:159)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1.invoke (PackageMojo.kt:124)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1.invoke (PackageMojo.kt:29)
    at kotlin.sequences.TransformingSequence$iterator$1.next (Sequences.kt:172)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2.invoke (PackageMojo.kt:166)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2.invoke (PackageMojo.kt:29)
    at kotlin.sequences.SequencesKt___SequencesKt$onEach$1.invoke (_Sequences.kt:1352)
    at kotlin.sequences.TransformingSequence$iterator$1.next (Sequences.kt:172)
    at kotlin.sequences.SequencesKt___SequencesKt.toCollection (_Sequences.kt:722)
    at kotlin.sequences.SequencesKt___SequencesKt.toMutableList (_Sequences.kt:752)
    at kotlin.sequences.SequencesKt___SequencesKt.toList (_Sequences.kt:743)
    at com.deviceinsight.helm.PackageMojo.processHelmConfigFiles (PackageMojo.kt:139)
    at com.deviceinsight.helm.PackageMojo.execute (PackageMojo.kt:73)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Add support for Helm 3

Helm 3 was released in November 2019. We should make sure the plugin works with both Helm 2 and 3.

Allow excluding files from property replacement

The helm package goal is performing property replacement implemented here.

While this feature makes sense for Kubernetes and helm manifests a developer might place arbitary files for content injection.
These files may contain text matching the property replacement regex (\\?)\$\{(.*?)} but should not be subject for property replacement.
In our case we have Grafana dashboard json files placed inside the chart.

It'd be great if you can configure a list of paths to exclude from property replacement, e.g.:

<configuration>
  <propertyReplacement>
    <exclusions>
      <exclusion>dashboards/alerting/**</exclusion>
      <exclusion>dashboards/infrastructure/kafka.json</exclusion>
    </exclusions>
  </propertyReplacement>
</configuration>

[Enhancement] - Make helm plugin thread safe

Since we use maven parallel build to speed up our builds, this is kind of a blocker due to errors unzipping the helm binary in parallel ("text file in use" kind of errors).

This is more of a brainstorming issue and i was wondering if there are other places which arent thread safe, and how would you attack this?
Maybe global lock(process level) for the downloadFileAndExtractBinary method ?

Switch to JUnit 5

We still have JUnit 4 as a dependency. We should switch to version 5 before any actual tests are written.

package goal does not work with helm 3 (tested with 3.3.3)

package goal fails with the following error:

[INFO] --- helm-maven-plugin:2.6.0:package (default) @ pon-api ---
[INFO] Clear target directory to ensure clean target package
[INFO] Created target helm directory
[ERROR] Output: Error: repository name (incubator) already exists, please specify a different name
[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.6.0:package (default) on project pon-api: Error creating helm chart: When executing '/Users/x/.m2/repository/com/deviceinsight/helm/helm/3.3.3/helm-3.3.3-darwin-amd64.binary repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com' got result code '1' -> [Help 1]

This is caused by the following line:
https://github.com/deviceinsight/helm-maven-plugin/blob/develop/src/main/kotlin/com/deviceinsight/helm/PackageMojo.kt#L80

With helm2 helm repo addcould be called multiple times. With helm3 the second invocation will throw an error.

helm:lint does not create /target/helm directory

Seems that the helm:lint does not create the /target/helm directory -- which means linting before packaging will fail with No such file or directory.

[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.1.0:lint (default) on project relos-api: Error rendering helm lint: Cannot run program "/Users/username/.m2/repository/com/deviceinsight/helm/helm/2.13.1/helm-2.13.1-darwin-amd64.binary" (in directory "/Users/username/projectname/target/helm"): error=2, No such file or directory 

Support for helm plugins

It would be good to have an option to execute arbitrary helm plugins.

for this we would need to be able to define plugins in the pom.xml similar to this:

<configuration>
    ...
    <plugins>
        <plugin>https://github.com/xyz/my-plugin</plugin>
    </plugins>
</configuration>
<executions>
    <execution>
        <goals>
            <goal>my-plugin</goal>
            <configuration>
              <options>
                <option>arg1</option>
                <option>arg2</option>
              </options>
            </configuration>
        </goals>
    </execution>
</executions>

Issue with helm publishing

Hi,

I am having issue when executing mvn helm:deploy and getting following error.

Error creating/publishing helm chart: Unexpected status code when executing POST request to chart repo https://mysitename.io/chartrepo/library: 404 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.8.0:deploy (default-cli) on project elastic-dijkstra: Error creating/publishing helm chart: Unexpected status code when executing POST request to chart repo https://mysitename.io/chartrepo/library: 404

I also tried the version 2.8.0

Please help on this

Allow for multiple package executions

If a project has multiple submodules that run helm:package, build pipelines will fail with recent versions of Helm (>= v3.3.2) because of a breaking change in the way how helm repo add behaves.

Before the change, it was acceptable to add a repository with the same name multiple times and after the change, this is no longer possible.

Optional chartRepoUrl

Why do I need to specify a chartRepoUrl in order to package and lint my chart? Could this be optional?

S3 is unsupported

Hi,

I'm currently using this maven plugin with my projet and I am currently using a S3 bucket as the helm chart repository.

Unfortunately I receive the following message when deploying with this plugin:
[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.10.0:deploy (helm) on project xxx: Error creating/publishing helm chart: null: ClientProtocolException: s3 protocol is not supported -> [Help 1]

Is it really not supported by the maven plugin currently or am I doing something wrong?

Thanks for your answer,

David

Package goal does not work with local dependencies

When using a wrapper chart with local dependencies in its requirements.yaml (e.g. file://../dependent-chart/), the package goal fails when running dependency update. This is because the files copied to target do not include local dependencies or dep up should be ran against source folder.

[DEBUG] Configuring mojo 'com.deviceinsight.helm:helm-maven-plugin:2.4.1:package' with basic configurator -->
[DEBUG]   (f) chartFolder = charts/hedera-mirror
[DEBUG]   (f) chartName = hedera-mirror
[DEBUG]   (f) chartRepoUrl = https://kubernetes-charts.storage.googleapis.com/
[DEBUG]   (f) chartVersion = 0.10.1
[DEBUG]   (f) helmArtifactId = helm
[DEBUG]   (f) helmDownloadUrl = https://get.helm.sh/
[DEBUG]   (f) helmGroupId = com.deviceinsight.helm
[DEBUG]   (f) helmVersion = 3.2.0
[DEBUG]   (f) localRepository =       id: local
      url: file:///Users/steven/.m2/repository/
   layout: default
snapshots: [enabled => true, update => always]
 releases: [enabled => true, update => always]

[DEBUG]   (f) project = MavenProject: com.hedera:hedera-mirror-node:0.10.1 @ /Users/steven/projects/hedera/hedera-mirror-node/pom.xml
[DEBUG]   (f) remoteRepositories = [      id: central
      url: https://repo.maven.apache.org/maven2
   layout: default
snapshots: [enabled => false, update => daily]
 releases: [enabled => true, update => daily]
]
[DEBUG]   (f) skip = false
[DEBUG] -- end configuration --
[INFO] Clear target directory to ensure clean target package
[INFO] Created target helm directory
[DEBUG] Processing helm files in directory /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/.DS_Store
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/.DS_Store
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/requirements.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/requirements.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/Chart.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/Chart.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/hedera-mirror-grpc-0.1.0.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/hedera-mirror-grpc-0.1.0.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/hedera-mirror-importer-0.1.0.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/hedera-mirror-importer-0.1.0.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/prometheus-operator-8.12.15.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/prometheus-operator-8.12.15.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/prometheus-adapter-2.2.0.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/prometheus-adapter-2.2.0.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/loki-stack-0.36.0.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/loki-stack-0.36.0.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/hedera-mirror-rest-0.1.0.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/hedera-mirror-rest-0.1.0.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/traefik-8.0.3.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/traefik-8.0.3.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/charts/postgresql-ha-2.3.1.tgz
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/charts/postgresql-ha-2.3.1.tgz
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/.helmignore
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/.helmignore
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/dashboards/jvm-micrometer-rev9.json
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/dashboards/jvm-micrometer-rev9.json
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/dashboards/postgresql-database_rev4.json
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/dashboards/postgresql-database_rev4.json
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/dashboards/postgres-overview_rev2.json
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/dashboards/postgres-overview_rev2.json
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/dashboards/kubernetes-cluster-monitoring-via-prometheus_rev2.json
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/dashboards/kubernetes-cluster-monitoring-via-prometheus_rev2.json
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/dashboards/traefik.json
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/dashboards/traefik.json
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/values-minimal.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/values-minimal.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/configmap-dashboards.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/configmap-dashboards.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/NOTES.txt
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/NOTES.txt
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/servicemonitor-traefik.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/servicemonitor-traefik.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/priorityclass.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/priorityclass.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/configmap-traefik.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/configmap-traefik.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/_helpers.tpl
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/_helpers.tpl
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/secret-pgpool.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/secret-pgpool.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/secret-postgresql.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/secret-postgresql.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/middleware-grafana.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/middleware-grafana.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/templates/networkpolicy.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/templates/networkpolicy.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/values.yaml
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/values.yaml
[DEBUG] Processing helm file /Users/steven/projects/hedera/hedera-mirror-node/charts/hedera-mirror/requirements.lock
[DEBUG] Copying to /Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror/requirements.lock
[DEBUG] When executing '/Users/steven/.m2/repository/com/deviceinsight/helm/helm/3.2.0/helm-3.2.0-darwin-amd64.binary repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com' in '/Users/steven/projects/hedera/hedera-mirror-node/target/helm', result was 0
[DEBUG] Output: "incubator" has been added to your repositories
[DEBUG] When executing '/Users/steven/.m2/repository/com/deviceinsight/helm/helm/3.2.0/helm-3.2.0-darwin-amd64.binary repo add chartRepo https://kubernetes-charts.storage.googleapis.com/' in '/Users/steven/projects/hedera/hedera-mirror-node/target/helm', result was 0
[DEBUG] Output: "chartRepo" has been added to your repositories
[DEBUG] When executing '/Users/steven/.m2/repository/com/deviceinsight/helm/helm/3.2.0/helm-3.2.0-darwin-amd64.binary dependency update' in '/Users/steven/projects/hedera/hedera-mirror-node/target/helm/hedera-mirror', result was 1
[ERROR] Output: Error: error unpacking hedera-mirror-rest-0.1.0.tgz in hedera-mirror: gzip: invalid header
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Hedera Mirror Node 0.10.1:
[INFO]
[INFO] Hedera Mirror Node ................................. FAILURE [  3.912 s]
[INFO] Hedera Mirror Node Importer ........................ SKIPPED
[INFO] Hedera Mirror Node Coverage ........................ SKIPPED
[INFO] Hedera Mirror Data Generator ....................... SKIPPED
[INFO] Hedera Mirror Node Protobuf ........................ SKIPPED
[INFO] Hedera Mirror Node GRPC API ........................ SKIPPED
[INFO] Hedera Mirror Node REST API ........................ SKIPPED
[INFO] Hedera Mirror Node Test ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.773 s
[INFO] Finished at: 2020-05-02T11:22:54-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.4.1:package (default-cli) on project hedera-mirror-node: Error creating helm chart: When executing '/Users/steven/.m2/repository/com/deviceinsight/helm/helm/3.2.0/helm-3.2.0-darwin-amd64.binary dependency update' got result code '1' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.4.1:package (default-cli) on project hedera-mirror-node: Error creating helm chart: When executing '/Users/steven/.m2/repository/com/deviceinsight/helm/helm/3.2.0/helm-3.2.0-darwin-amd64.binary dependency update' got result code '1'
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating helm chart: When executing '/Users/steven/.m2/repository/com/deviceinsight/helm/helm/3.2.0/helm-3.2.0-darwin-amd64.binary dependency update' got result code '1'
    at com.deviceinsight.helm.PackageMojo.execute (PackageMojo.kt:93)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: java.lang.RuntimeException: When executing '/Users/steven/.m2/repository/com/deviceinsight/helm/helm/3.2.0/helm-3.2.0-darwin-amd64.binary dependency update' got result code '1'
    at com.deviceinsight.helm.AbstractHelmMojo.executeCmd (AbstractHelmMojo.kt:118)
    at com.deviceinsight.helm.AbstractHelmMojo.executeCmd$default (AbstractHelmMojo.kt:104)
    at com.deviceinsight.helm.PackageMojo.execute (PackageMojo.kt:87)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Authorization for fetching dependency charts

Currently, authentication is only supported when publishing charts to a repository. If the repository where charts should be downloaded also requires authentication, the plugin fails to package the chart.

lateinit property chartVersion has not been initialized

This is either a bug in the documentation or in the code.

Using v2.4.0 of the plugin mvn deploy fails with the following error message:

[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.4.0:deploy (default) on project app-standalone: Error creating/publishing helm chart: lateinit property chartVersion has not been initialized -> [Help 1]

Only when I add <chartVersion>${project.model.version}</chartVersion> to the plugin configuration, which is the default according to the documentation, the error goes away.

<plugin>
    <groupId>com.deviceinsight.helm</groupId>
    <artifactId>helm-maven-plugin</artifactId>
    <version>${helm-maven-plugin.version}</version>
    <configuration>
        <chartVersion>${project.model.version}</chartVersion>
    ...

Stacktrace:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.4.0:de
ploy (default) on project app-standalone: Error creating/publishing helm chart: lateinit property chartVersion has not b
een initialized
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating/publishing helm chart: lateinit property chartVersion
has not been initialized
    at com.deviceinsight.helm.DeployMojo.execute (DeployMojo.kt:130)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property chartVersion has not been initialized
    at com.deviceinsight.helm.DeployMojo.execute (DeployMojo.kt:102)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Make package goal more lenient

Since the following commit an exception is thrown if a property cannot be reolved.

9b8ceca

It would be sufficient if you logged a warning instead.

Caused by: java.lang.IllegalStateException: Could not resolve property: 'test' used in file: '/home/test/projects/test/test/target/helm/test/templates/deployment.yaml'
    at com.deviceinsight.helm.PackageMojo.findPropertyValue (PackageMojo.kt:160)
    at com.deviceinsight.helm.PackageMojo.access$findPropertyValue (PackageMojo.kt:29)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1$1.invoke (PackageMojo.kt:133)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1$1.invoke (PackageMojo.kt:29)
    at kotlin.text.Regex.replace (Regex.kt:159)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1.invoke (PackageMojo.kt:130)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2$$special$$inlined$use$lambda$1.invoke (PackageMojo.kt:29)
    at kotlin.sequences.TransformingSequence$iterator$1.next (Sequences.kt:172)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2.invoke (PackageMojo.kt:171)
    at com.deviceinsight.helm.PackageMojo$processHelmConfigFiles$processedFiles$2.invoke (PackageMojo.kt:29)
    at kotlin.sequences.SequencesKt___SequencesKt$onEach$1.invoke (_Sequences.kt:1352)
    at kotlin.sequences.TransformingSequence$iterator$1.next (Sequences.kt:172)
    at kotlin.sequences.SequencesKt___SequencesKt.toCollection (_Sequences.kt:722)
    at kotlin.sequences.SequencesKt___SequencesKt.toMutableList (_Sequences.kt:752)
    at kotlin.sequences.SequencesKt___SequencesKt.toList (_Sequences.kt:743)
    at com.deviceinsight.helm.PackageMojo.processHelmConfigFiles (PackageMojo.kt:144)
    at com.deviceinsight.helm.PackageMojo.execute (PackageMojo.kt:74)

[Version 2.3.0] helm:lint cannot find values.yaml

Hi,

I've just upgrade the plugin to the new 2.3.0 release from 2.1.0, and even tried 2.2.0, for our project, but I only encountered this problem on the 2.3.0 verion.

Here's my config:

<plugin>
    <groupId>com.deviceinsight.helm</groupId>
    <artifactId>helm-maven-plugin</artifactId>
    <version>2.3.0</version>
    <configuration>
        <chartName>${project.parent.artifactId}</chartName>
        <chartRepoUrl>${helm-repo.url}</chartRepoUrl>
        <helmVersion>${helm.version}</helmVersion>
        <valuesFile>src/test/helm/abc-app/values.yaml</valuesFile>
        <strictLint>false</strictLint>
        <skipSnapshots>false</skipSnapshots>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>package</goal>
                <goal>lint</goal>
                <goal>template</goal>
                <goal>deploy</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Linting passed in local, however, problem occurs when code got committed to Gitlab.

Gitlab config:

mvn_test_job:
  stage: build
  script: >
    mvn clean verify --update-snapshots --batch-mode --activate-profiles sonar \
     -Dsonar.host.url=$SONAR_URL \
     -Dsonar.login=$SONAR_LOGIN \
     -Dsonar.analysis.mode=preview \
     -Dsonar.gitlab.project_id=$CI_PROJECT_ID \
     -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA \
     -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME \
     -Dsonar.gitlab.unique_issue_per_inline=true \
     -Dsonar.gitlab.url=https://gitlab.our-domain.com \
     -Dsonar.gitlab.user_token=$USER_TOKEN \
     -Dsonar.gitlab.disable_proxy=true \
     -Dsonar.gitlab.only_issue_from_commit_file=true \
     -Dstyle.color=always
  artifacts:
    paths:
      - "*/target/*-reports/*"
      - "*/target/*.log"
      - "*/target/generated-docs"
    when: always
    expire_in: 1 week
  except:
    - schedules
    - master
    - develop
    - tags
  tags:
    - dind

Error log:

 [INFO] --- helm-maven-plugin:2.3.0:package (default) @ abc-app-standalone ---
 [INFO] Clear target directory to ensure clean target package
 [INFO] Created target helm directory
 [INFO] Successfully packaged chart and saved it to: /builds/abc/abc-app/abc-app-standalone/target/helm/abc-app-0.4.0-SNAPSHOT.tgz
 [INFO] 
 [INFO] --- helm-maven-plugin:2.3.0:lint (default) @ abc-app-standalone ---
 [INFO] Output: Error: open "/builds/abc/abc-app/abc-app-standalone/src/test/helm/abc-app/values.yaml": no such file or directory
 [INFO] ------------------------------------------------------------------------

Any idea why?

Issue on init helm for packaging execution

Hi,

I'm having an issue when executing the mvn clean install and getting the following error.

[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.8.1:package (default) on project test-k8s: Error creating helm chart: When executing '/root/.m2/repository/com/deviceinsight/helm/helm/2.14.3/helm-2.14.3-linux-amd64.binary init --client-only' got result code '1' -> [Help 1]

this is my pom build:

<build>
        <sourceDirectory>src/main/test</sourceDirectory>
        <outputDirectory>target/test</outputDirectory>
        <plugins>
            <plugin>
                <groupId>com.deviceinsight.helm</groupId>
                <artifactId>helm-maven-plugin</artifactId>
                <version>2.8.1</version>
                <configuration>
                    <chartFolder>src/main/test</chartFolder>
                    <chartRepoUrl>https://charts.helm.sh/stable</chartRepoUrl>
                    <helmVersion>2.14.3</helmVersion>
                    <strictLint>true</strictLint>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>package</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src\main\test</directory>
                <includes>
                    <include>**/*.yaml</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
    </build>

Edit by @pvorb: Fix formatting of pom.xml

Will this plugin work with OCI-compatible registry?

we are using Harbor and Harbor has two distinct Helm Chart options :

  1. ChartMuseum
  2. OCI Part, supported by Helm3

I am asking, as I see this error here: It seems ChartMuseum is used but I would like to use OCI compatible
Error creating/publishing helm chart: Unexpected status code when executing POST request to chart repo https://8gears.container-registry.com/chartrepo/library/api/charts: 404

Make sure `chartRepo` does not exist before executing helm repo add

When the previous build was interrupted for some reason, a repository named chartRepo can continue to stick around.

This prevents future runs of the helm-maven-plugin by causing the following error:

[ERROR] Output: Error: repository name (chartRepo) already exists, please specify a different name
[…]
[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.8.1:package (default) on project project-name: Error creating helm chart: When executing '/home/walsermi/.m2/repository/com/deviceinsight/helm/helm/3.4.2/helm-3.4.2-linux-amd64.binary repo add chartRepo https://repo-url/ --username xxx --password yyy' got result code '1' -> [Help 1]

Ideally the helm-maven-plugin should detect such a situation and perform a clean-up operation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.