如何在maven clean阶段删除文件夹?

How to delete a folder at maven clean phase?

我想在清理阶段删除一个文件夹。

我已经使用maven-clean-plugin成功删除了它下面的所有文件

        <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>3.0.0</version>

            <configuration>
                <filesets>
                    <fileset>
                        <directory>GENERATED_DIR</directory>
                        <includes>
                            <include>**/*</include>
                        </includes>
                        <followSymlinks>false</followSymlinks>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>

我也想删除"GENERATED_DIR"。

以下适合我

    <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
            <filesets>
                <fileset>
                    <directory>${basedir}/GENERATED_DIR</directory>
                </fileset>
            </filesets>
        </configuration>
    </plugin>

这终于对我有用

        <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>${basedir}</directory>
                        <includes>
                            <include>**/GENERATED_DIR/**</include>
                        </includes>
                        <followSymlinks>false</followSymlinks>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>