在Jenkins中拉存储库时出现长路径错误

问题描述 投票:0回答:2

我正在尝试使用Jenkins提取存储库,默认情况下,Jenkins创建一个冗长且不可读的工作空间名称。我因此得到了这个错误:

Caused by: com.microsoft.tfs.core.exceptions.TECoreException: The 
specified path, file name, or both are too long. The fully qualified 
file name must be less than 260 characters, and the directory name must 
be less than 248 characters.

请问任何人请帮助我如何解决这个问题,在配置文件中添加任何参数会有帮助吗?

jenkins jenkins-plugins jenkins-pipeline
2个回答
0
投票

轶事思想,但有两种选择:

  • 确保检查repo文件“更接近”底层文件系统的根目录,这样repo可以包含更长的文件名/路径(例如使用C:\code而不是像C:\company\project\jenkins...那样)
  • 考虑你的仓库中导致如此长文件名的任何内容 - 我个人在使用NodeJS时看到了这一点,并且在源代码管理中跟踪了node_modules文件夹,深入了解多个文件夹

0
投票

找到解决方案,只需在jenkins.xml中添加此参数并重启jenkins即可解决问题。

-Djenkins.branch.workspaceLocatorImpl.PATH_MAX=0 
© www.soinside.com 2019 - 2024. All rights reserved.