jenkins编译项目出现磁盘空间不足
2022-06-24 本文已影响0人
Aaha
1.现象
ERROR: Failed to parse POMs
java.nio.file.FileSystemException: /var/lib/jenkins/workspace/XL-NETWORK-DOCKER/xl-websocket/target/xl-websocket.jar -> /var/lib/jenkins/jobs/XL-NETWORK-DOCKER/modules/com.xl$xl-websocket/builds/40/archive/com.xl/xl-websocket/1.0.0/xl-websocket-1.0.0.jar: No space left on device
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:253)
at sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:581)
at sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
at java.nio.file.Files.copy(Files.java:1274)
2.原因
# cd /var/lib/jenkins
# du -h --max-depth=1
发现 jobs历史文件占用空间很大
3.解决
jenkins工程 -> 配置 -> General -> 选中“丢弃旧的构建” -> “ 保持构建的最大个数” , 根据需要设置成只保留最近5次编译