Skip to content

fix: log debug message when root directory is unavailable in fast clean fallback - #364

Open
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:fix/cleanup-tmpdir-in-cleanmojo
Open

gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:fix/cleanup-tmpdir-in-cleanmojo

Conversation

@gnodet

@gnodet gnodet commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

When session.getRootDirectory() throws IllegalStateException (embedded/standalone usage without a root directory), log a debug message before falling back to the system temp directory. Also initialises rootDir to null explicitly for clarity.

Note: in a standard Maven 4 CLI build, getRootDirectory() never throws — the root directory is always resolved before mojo execution. This fallback path is only reachable from embedded usage.

Addresses review feedback from @desruisseaux on #362.

…an fallback

When session.getRootDirectory() throws IllegalStateException (embedded usage),
log a debug message before falling back to the system temp directory.
Also initialise rootDir to null explicitly for clarity.

Addresses review feedback from @desruisseaux on apache#362.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid — replaces a silent empty catch with an explicit debug log (exception chained), and moves the null init to the declaration for clarity. No behavioral change in the normal Maven CLI path; the fallback to system temp dir was already working, this just makes it observable at debug level for embedded usage.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants