Use ${maven.multiModuleProjectDirectory}/spotless.xml.prefs for robust resolution#189
Merged
Merged
Conversation
…ust resolution
The relative `./spotless.xml.prefs` path resolves correctly when Maven
is invoked from the multi-module root, but can fail when invoked from
elsewhere (e.g., a submodule's `basedir`, an IDE's per-module run, or
nested Maven invocations). Switching to the
`${maven.multiModuleProjectDirectory}` property — which always points
at the directory containing the parent `pom.xml` — makes resolution
robust regardless of invocation context.
Matches the pattern downstream consumers like
`ponder-lab/Hybridize-Functions-Refactoring` already use for the same
file. Verified `mvn spotless:check` and
`mvn -pl com.ibm.wala.cast.python.ml spotless:check` both succeed
after the change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the Maven Spotless configuration to reference the shared Eclipse WTP formatting prefs via Maven’s multi-module root directory, making formatting checks more robust across different invocation contexts in this multi-module build.
Changes:
- Switch Spotless
eclipseWtpXML prefs path from a relative path (./spotless.xml.prefs) to${maven.multiModuleProjectDirectory}/spotless.xml.prefs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-opening of #188, which was inadvertently closed when its branch (
chore/spotless-prefs-multi-module-path) was deleted during cleanup of a sibling upstream PR. Same content, new branch (-forksuffix to disambiguate from the upstream-targeted PR's branch of the same prefix).Problem
pom.xmlreferences the Spotless prefs file with a relative path:Relative paths resolve against Maven's current working directory at invocation time. Works from the multi-module root but can fail from elsewhere — submodule's
basedir, IDE's per-module run, nested Maven invocation.Fix
Use
${maven.multiModuleProjectDirectory}for invocation-context-independent resolution:Same pattern downstream consumers like
ponder-lab/Hybridize-Functions-Refactoringalready use.Verification
Related
${maven.multiModuleProjectDirectory}/spotless.xml.prefsfor robust resolution wala/ML#432 — same fix on upstream (correctly branched fromwala/master).