maven - Maven 和 jenkins 'mvn' 未被识别为内部或外部命令、可运行程序或批处理文件
问题描述
我已经在cmd中手动编译了maven,它是成功的。但是,当我尝试运行 jenkins 工作时,它说
"'mvn' is not recognized as an internal or external command,
operable program or batch file."
詹金斯控制台输出:
enter code hereStarted by user prakash peram
在工作区 C:\Program Files (x86)\Jenkins\workspace\atmosphere3 中构建
git.exe rev-parse --is-inside-work-tree # timeout=10 从远程 Git 存储库获取更改 git.exe config remote.origin.url https://github.com/g0t4/jenkins2-course-spring -boot.git # timeout=10 从https://github.com/g0t4/jenkins2-course-spring-boot.git获取上游更改 git.exe --version # timeout=10 git.exe fetch --tags --进度https://github.com/g0t4/jenkins2-course-spring-boot.git +refs/heads/ :refs/remotes/origin/ git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10 签出修订版 4bde91e33e2860b2aab142028c04eff37b7791f2 (refs/remotes/origin/master) git.exe config core.sparsecheckout # timeout=10 git.exe checkout -f 4bde91e33e2860b2aab142028c04eff37b7791f2" Commit message: "Adding in rev-list --no code coverage git.exe 4bde91e33e2860b2aab142028c04eff37b7791f2 # timeout=10 [atmosphere3] $ cmd.exe /C "mvn -f spring-boot-samples/spring-boot-sample-atmosphere/pom.xml compile && exit %%ERRORLEVEL%%" 'mvn' 无法识别作为内部或外部命令、可运行程序或批处理文件。构建步骤“调用顶级 Maven 目标”将构建标记为失败已完成:
我已经在环境变量中设置了 MVN_HOME 和 M2_HOME。
如果需要,请寻求更多信息。
解决方案
推荐阅读
- java - 如何在选定的场景中实现按值传递?
- php - 在函数内部优化 PHP 中的大数组操作
- c++ - 如何检索模板化对象实例化的类型?
- typescript - 无法访问变量
- c# - IdentityServer4:无法从以下位置获取配置:'https://myServer/.well-known/openid-configuration
- c++ - 如何测试 unicode 字符(char32_t)在 C++ 中是否为大写
- php - 从一个表中获取 id 并同时插入另一个表
- authentication - 如何通过负载均衡策略更好地利用本地缓存?
- sql - 带有 ASPEN Sqlplus 的 Matlab 数据浏览器应用程序
- javascript - Lodash uniqBy 更新最新值