Repository navigation
Launch Windows Java build wrappers with an explicit .\ path - #20895
Open
Jonas Flodén (flojon) wants to merge 1 commit into
Open
Jonas Flodén (flojon) wants to merge 1 commit into
Jonas Flodén (flojon) wants to merge 1 commit into
Conversation
cmd.exe only finds a bare mvnw.cmd or gradlew.bat in the working directory while it searches the current directory, and NoDefaultCurrentDirectoryInExePath=1 turns that search off. Launching failed with "'mvnw.cmd' is not recognized as an internal or external command". Prefix the relative wrapper path with "." so it is always treated as a path, in both the hosted Java resources and the Java AppHost toolchain resolver. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Jonas Flodén (flojon)
requested review from
James Newton-King (JamesNK),
David Fowler (davidfowl) and
Mitch Denny (mitchdenny)
as code owners
October 10, 2026 15:37
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20895Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20895" |
Contributor
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This branch has not been deployed
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.
Description
Launching a Windows Java build wrapper fails with
'mvnw.cmd' is not recognized as an internal or external commandwhenNoDefaultCurrentDirectoryInExePath=1is set.Aspire runs the wrapper as
cmd /c call mvnw.cmd ...with the working directory set to the application.cmd.exeonly finds a bare name in the working directory while it searches the current directory, andNoDefaultCurrentDirectoryInExePath=1turns that search off.This prefixes the relative wrapper path with a
.segment (mvnw.cmdbecomes.\mvnw.cmd,..\xbecomes.\..\x) so it is always treated as a path. Absolute paths, such as a wrapper on another drive, are left alone. It is fixed in both places that build this command line:WrapperInvocationForinAspire.Hosting.Java, used by hosted Java resourcesJavaAppHostToolchainResolverinAspire.Cli, used for Java AppHostsVerification
NoDefaultCurrentDirectoryInExePath=1,cmd /c "call mvnw.cmd -v"fails with the error above andcmd /c "call .\mvnw.cmd -v"starts Maven.Aspire.Hosting.Java.Testsand theJavaAppHostToolchainResolverTestsinAspire.Cli.Testspass. I updated the five existing expectations that asserted the bare-name form.Not verified: an end-to-end AppHost run with this change.
Fixes # (issue)
Checklist
🤖 Generated with Claude Code