terraform-maven icon indicating copy to clipboard operation
terraform-maven copied to clipboard

tf:clean jumps up two levels of parent directory, eventually errors with Nullpointer for 'src/main/<custom_root_dir>'

Open palaniswamy opened this issue 4 years ago • 0 comments

When tf:clean goal is invoked with tfRootDir=src/main/<custom_root_dir>, the TerraformClean jumps up two levels of parent directory and eventually error as Path("") is evaluated at some point.

Steps to reproduce the behavior:

  1. Create a terraform configuration like below /src/main/tf_root_dir
  2. Run tf:clean -DtfRootDir=tf_root_dir
  3. (side effect) The above command also cleans up other modules under "src"

Expected behavior tf:clean cleans up .terraform and .tfstate files only in the given Root Directory, not in other directories.

palaniswamy avatar Aug 05 '21 15:08 palaniswamy