
com.deliveredtechnologies.maven.terraform.mojo.Clean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tf-maven-plugin Show documentation
Show all versions of tf-maven-plugin Show documentation
Terraform Maven Plugin :: Bringing build lifecycle management to Terraform!
The newest version!
package com.deliveredtechnologies.maven.terraform.mojo;
import com.deliveredtechnologies.terraform.TerraformException;
import com.deliveredtechnologies.terraform.api.TerraformClean;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.IOException;
/**
* Mojo clean goal.
*
* Deletes all terraform files from terraform configurations along with terraform modules directory.
*/
@Mojo(name = "clean", defaultPhase = LifecyclePhase.CLEAN)
public class Clean extends TerraformMojo {
@Parameter(property = "tfRootDir")
String tfRootDir;
@Parameter(property = "tfModulesDir")
String tfModulesDir;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
try {
execute(new TerraformClean(tfModulesDir, tfRootDir), getFieldsAsProperties());
} catch (IOException | TerraformException e) {
throw new MojoExecutionException(e.getMessage(), e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy