Skip to content

cleanConf Gradle task deletes the wrong directory in projects with non-standard layout - #5621

Merged
knstvk merged 1 commit into
masterfrom
5619-cleanConf-dir
Sep 14, 2026
Merged

knstvk merged 1 commit into
masterfrom
5619-cleanConf-dir

Conversation

@knstvk

@knstvk knstvk commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5619

Problem

cleanConf defaults the conf dir to ${project.rootDir}/.jmix/conf, while the running application resolves jmix.core.conf-dir against its working directory, which for bootRun is the project directory of the application module. The two agree only when projectDir == rootDir. In a build where the application is a subproject with a custom projectDir, cleanConf cleans a directory nobody uses, so stale hot-deployed files in the real conf dir are never removed. A property value containing ${user.dir} was also used verbatim, so the task tried to delete a directory literally named ${user.dir}.

Changes

JmixPlugin.resolveConfDir now returns a File produced by project.file(...), so every path resolves against projectDir: the default becomes <projectDir>/.jmix/conf, a relative property value resolves against projectDir, an absolute one is used as is, and the ${user.dir} and ${user.home} placeholders are expanded before resolution. Nothing changes for single-module and composite-build projects.

Tests

CleanConfFunctionalTest with a fixture that reproduces the layout (include ':app' plus a custom projectDir) covers the default, relative, absolute and ${user.dir} cases. The default and placeholder cases fail without the fix. Verified green: the whole jmix-gradle-plugin suite, 17 tests, with -PincludeSlowTests=true.

Note for reviewers: this aligns cleanConf with gradlew bootRun and the application module root. It does not match the current Studio run configuration, which uses the IntelliJ project base dir as the working directory — that is the Studio-side part of #5517.

@knstvk
knstvk requested a review from Gavrilov-Ivan August 27, 2026 06:51
@knstvk
knstvk merged commit e373ffb into master Sep 14, 2026
@knstvk
knstvk deleted the 5619-cleanConf-dir branch September 14, 2026 14:26
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.

cleanConf Gradle task deletes the wrong directory in projects with non-standard layout

2 participants