4

I want do delete a folder at clean phase.

I have used maven-clean-plugin and successfully deleted all of the files under it.

        <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>

I want to delete "GENERATED_DIR" as well.

aurelius
  • 3,946
  • 7
  • 40
  • 73

2 Answers2

7

The following works for me

    <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
            <filesets>
                <fileset>
                    <directory>${basedir}/GENERATED_DIR</directory>
                </fileset>
            </filesets>
        </configuration>
    </plugin>
Essex Boy
  • 7,565
  • 2
  • 21
  • 24
2

This finally worked for me

        <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>
aurelius
  • 3,946
  • 7
  • 40
  • 73