Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove directory with maven-clean-plugin

Can I delete directory with maven-clean-plugin?

The following configuration deletes files from the given directory but the directory itself will be remained:

<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>2.4.1</version>
    <configuration>
        <filesets>
            <fileset>
                <directory>src/main/javascript/node_modules</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <followSymlinks>false</followSymlinks>
            </fileset>
        </filesets>
    </configuration>
</plugin>

I have checked the plugin's documentation but I can not see any way to delete the directory: http://maven.apache.org/plugins-archives/maven-clean-plugin-2.6.1/clean-mojo.html

I need to delete the directory as well.

like image 746
zappee Avatar asked Dec 14 '17 06:12

zappee


1 Answers

Finally I have figured out what is the solution. The file pattern what I used was wrong.

The following file mask deletes files from the given directory but the folder will be remained:

<include>**/*</include>

This pattern deletes the directory as well:

<include>**</include>
like image 128
zappee Avatar answered Oct 12 '22 11:10

zappee