Gitlab CI/CD runner : mvn command not found

前端 未结 4 1938
借酒劲吻你
借酒劲吻你 2021-01-06 06:17

Maven is well installed on my gitlab-runner server. When executing mvn clean directly on my repo it works, when running my pip

4条回答
  •  自闭症患者
    2021-01-06 06:37

    I hope you had figure out your question. I met the same question when I build my ci on my server.

    I use the shell as the executer for my Runner. here are the steps to figure out.

    1 check the user on the runner server

    if you had install maven on the runner server successfully, maybe it just successful for the root, u can check the real user for the ci process.

    job1:
      stage: test
      script:  whoami
    

    if my case, it print gitlab-runner, not the root

    2 su the real user, check mvn again

    In this time, it print error as same as the Gitlab ci UI.

    3 install maven for the real user. run the pipeline again.

提交回复
热议问题