diff --git a/README.md b/README.md index a2877a1..63ca1ab 100644 --- a/README.md +++ b/README.md @@ -597,6 +597,21 @@ normal circumstances. Default: `${project.basedir}/target/habushu.placeholder.txt` + +#### distDirectory #### + +Controls where the clean plugin will delete dist artifacts. + +Default: `${project.basedir}/dist` + + +#### targetDirectory #### + +Controls where the clean plugin will delete target artifacts. + +Default: `${project.basedir}/target` + + ## The Habushu Build Lifecycle ## Habushu applies a [custom Maven lifecycle that binds Poetry-based DevSecOps workflow commands](https://fermenter.atlassian.net/wiki/spaces/HAB/pages/2056749057/Dependency+Management+and+Build+Automation+through+Poetry+and+Maven) to the following phases: diff --git a/habushu-maven-plugin/src/main/java/org/technologybrewery/habushu/CleanHabushuMojo.java b/habushu-maven-plugin/src/main/java/org/technologybrewery/habushu/CleanHabushuMojo.java index ded7c10..27e8ddd 100644 --- a/habushu-maven-plugin/src/main/java/org/technologybrewery/habushu/CleanHabushuMojo.java +++ b/habushu-maven-plugin/src/main/java/org/technologybrewery/habushu/CleanHabushuMojo.java @@ -39,6 +39,12 @@ public class CleanHabushuMojo extends CleanMojo { @Parameter(defaultValue = "${project.basedir}/dist", readonly = true, required = true) protected File distDirectory; + /** + * Directory in which Maven places build-time artifacts - should NOT include dist items. + */ + @Parameter(defaultValue = "${project.basedir}/target", readonly = true, required = true) + protected File targetDirectory; + /** * Enables the explicit deletion of the virtual environment that is * created/managed by Poetry. @@ -125,11 +131,15 @@ public void execute() throws MojoExecutionException { try { Fileset distArchivesFileset = createFileset(distDirectory); filesetsToDelete.add(distArchivesFileset); + + Fileset targetArchivesFileset = createFileset(targetDirectory); + filesetsToDelete.add(targetArchivesFileset); } catch (IllegalAccessException e) { throw new MojoExecutionException("Could not write to private field in Fileset class.", e); } getLog().info(String.format("Deleting distribution archives at %s", distDirectory)); + getLog().info(String.format("Deleting target archives at %s", targetDirectory)); setPrivateParentField("filesets", filesetsToDelete.toArray(new Fileset[0])); super.execute();