我在 Jenkins 工具中创建了一个工作。我遇到这样的错误
Started by user CodeBind
Running as SYSTEM
Building in workspace C:\Users\user_\OneDrive\Desktop\access-mgmt
[access-mgmt] $ cmd.exe /C "mvn -s "C:\Users\user_\OneDrive\Desktop\access-mgmt\""C:\Users\user_\OneDrive\Desktop\access-mgmt""" -gs "C:\Users\user_\OneDrive\Desktop\access-mgmt\""C:\Users\user_\OneDrive\Desktop\access-mgmt""" clean package && exit %%ERRORLEVEL%%"
'mvn' is not recognized as an internal or external command,
operable program or batch file.
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
我通过更改路径位置进行了很多尝试
转到仪表板 -> 管理 Jenkins -> 工具
在Maven安装部分,选择maven版本并将其命名为maven。添加maven然后保存。
请参阅有关如何使用 Jenkinsfile 中的工具的文档: https://www.jenkins.io/doc/book/pipeline/syntax/#tools