在 GoCD mvn clean install 中,mvn' is not recognized as an internal or external command 但正常的 cmd 项目构建成功

In GoCD mvn clean install is giving mvn' is not recognized as an internal or external command but normal cmd project builds successfully

在 GoCD mvn clean install 中出现错误 mvn' is not recognized as an internal or external command 但在正常的 cmd 中我能够成功构建项目

GoCD 构建错误

正常构建:

看起来 mvn 不在 go-agent 使用的 PATH 中。

尝试在您的 GoCD 任务中指定 mvn 执行的绝对路径。