Skip to content

New clean goal makes the build fail, if the plugin-specific chart directory is not present #408

@fbuetler

Description

@fbuetler

Context: 6.17.0 introduced a new clean goal.

Starting with 6.17.0 the helm-maven-plugin fails in the clean goal, if the chart directory is not present.

The issue occurs if the chartDirectory is set to maven's project.build.directory.

As it is very common to run maven with a preceding clean e.g. maven clean deploy, this error is usually hit, because clean already removes the directory in the target directory.

This issue did not occur with version 6.16.0.

I'd propose to first check if the directory is present and skip the removal otherwise.

Current work around is disabling the clean stage of the helm-maven-plugin:

<execution>
    <id>default-clean</id>
    <phase>none</phase>
</execution>

EDIT:

The error actually does not occur during the actual deletion, as this already deletes the directory only if it exists:

With the following error message:

[ERROR] Failed to execute goal io.kokuwa.maven:helm-maven-plugin:6.17.0:clean (default-clean) on project helm: Unable to scan chart directory at [...]/helm/target/uniport-gateway -> [Help 1]

The issue is here:

throw new MojoExecutionException("Unable to scan chart directory at " + chartDirectory, e);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions