Skip to content

fix: support maven module path pointing directly to pom.xml#2320

Open
cuixq wants to merge 1 commit into
google:mainfrom
cuixq:fix
Open

fix: support maven module path pointing directly to pom.xml#2320
cuixq wants to merge 1 commit into
google:mainfrom
cuixq:fix

Conversation

@cuixq

@cuixq cuixq commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

When a Maven <module> tag points directly to a POM file (e.g. <module>abc/pom.xml</module>) instead of a directory, SCALIBR incorrectly appended /pom.xml to it (resulting in app/pom.xml/pom.xml), failing with a not a directory error.

To resolve this error, this PR uses fs.Stat to check if the module path is a file. If it exists and is not a directory, resolve it directly. Otherwise, fall back to appending /pom.xml.

Also added TestDiscoverModules in internal/mavenutil/maven_test.go to cover both directory and direct file module definitions.

@cuixq
cuixq marked this pull request as ready for review July 22, 2026 03:07
@cuixq
cuixq requested a review from another-rex July 22, 2026 03:29
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.

1 participant