# 在项目 my-app 上执行目标 org.apache.maven.plugins:maven-site-plugin:3.12.0:site (default-site) 失败：生成站点时出错：java.io.IOException: 无法创建目录 /path/to/target/site。

- **ID:** `java/maven-site-plugin-error`
- **领域:** java
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

目标目录不可写或文件系统已满，导致站点插件无法创建输出目录。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 8+ | active | — | — |

## 解决方案

1. **Ensure the target directory exists and is writable** (95% 成功率)
   ```
   mkdir -p /path/to/target && chmod 755 /path/to/target
   ```
2. **Free up disk space or use a different output directory** (90% 成功率)
   ```
   mvn site -Dsite.outputDirectory=/tmp/site
   ```

## 无效尝试

- **Changing the site output directory to a random path** — The new path may also have permission issues or be non-existent. (70% 失败率)
- **Running Maven as root** — This is a security risk and may not solve filesystem full issues. (60% 失败率)
