sh " mvn clean package "

问题遇到的现象和发生背景

jenkins 打包

问题相关代码,请勿粘贴截图

sh " mvn clean package "

运行结果及报错内容

[Pipeline] sh

  • mvn clean package
    [ERROR] Could not create local repository at /home/repo -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LocalRepositoryNotAccessibleException
    我的解答思路和尝试过的方法
    chmod 777 /home/repo
    我想要达到的结果
    解决

这个不是sh格式文件,服务器上如果设置了maven全局环境的话,直接在项目内执行 maven clean package