术语' mvn'在Gitlab CI CD CD Pipeline yaml文件中未被认为是cmdlet的名称
尝试使用gitlab特定跑步者获得错误构建Maven项目 我的.gitlab-ci.yml含量
variables:
MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
image: maven:latest
stages:
- build
- test
- package
- deploy
cache:
paths:
- .m2/repository
- target
build_job:
stage: build
tags:
- docker
script:
- echo "Maven compile started"
- "mvn compile"
test_job:
stage: test
tags:
- docker
script:
- echo "Maven test started"
- "mvn test"
package_job:
stage: package
tags:
- docker
script:
- echo "Maven packaging started"
- "mvn package"
Deploy_job:
stage: deploy
tags:
- docker
script:
- echo "Maven deploy started"
error : $ mvn compile
mvn : The term 'mvn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\WINDOWS\TEMP\build_script1691068991\script.ps1:243 char:1
+ mvn compile
+ ~~~
+ CategoryInfo : ObjectNotFound: (mvn:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
trying build maven project using gitlab specific runner getting error
My .gitlab-ci.yml content
variables:
MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
image: maven:latest
stages:
- build
- test
- package
- deploy
cache:
paths:
- .m2/repository
- target
build_job:
stage: build
tags:
- docker
script:
- echo "Maven compile started"
- "mvn compile"
test_job:
stage: test
tags:
- docker
script:
- echo "Maven test started"
- "mvn test"
package_job:
stage: package
tags:
- docker
script:
- echo "Maven packaging started"
- "mvn package"
Deploy_job:
stage: deploy
tags:
- docker
script:
- echo "Maven deploy started"
error : $ mvn compile
mvn : The term 'mvn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\WINDOWS\TEMP\build_script1691068991\script.ps1:243 char:1
+ mvn compile
+ ~~~
+ CategoryInfo : ObjectNotFound: (mvn:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)