简介
Publish over FTP是Jenkins中用于FTP传输文件的插件。
报错:Could not create or change to directory
这个是因为不支持中文目录。
虽然Jenkins说明中推荐中文配置为GB2312,但其实我们一般通用的作法是设置为UTF-8,兼容各类操作系统和构建环境。
处理
【系统管理】->【系统设置】->【Publish over FTP】->高级:【Control encoding】->输入【UTF-8】或者【GB2312】
报错:Could not write file
不支持FTP被动模式(PASV)
一种是在FTP服务端开启PASV被动模式(一般默认两种模式都开启了,但不排除没有开启的情况,就导致这个问题)
另一种方式就是改变Jenkins的连接模式,通过官网也能找到这一段话:
Use active data mode
By default passive mode will be used to connect to the FTP Server.
In passive mode the client initiates all connections which will allow the client to send files through a firewall that has been configured to refuse all inbound connections (and does not create dynamic rules).
If you want to dissable passive mode, and have the client use PORT commands for the server to connect to the client to retieve the files, then you can check this box.
解决
【系统管理】->【系统设置】->【Publish over FTP】->高级:勾选【Use active data mode】