問題描述
Maven wildcard cocok dengan nama folder parsial (Maven wildcard match on partial folder name)
With the maven‑clean‑plugin I would like to remove all folders that start with "tmp". Is this possbile with maven wildcards? I have tried:
<fileset>
<directory>${project.basedir}</directory>
<includes>
<include>**/tmp*</include>
</includes>
</fileset>
Which does not work.
‑‑‑‑‑
參考解法
方法 1:
This configuration works for me:
<plugin>
<artifactId>maven‑clean‑plugin</artifactId>
<version>2.5</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}</directory>
<includes>
<include>**/tmp*/</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
If I add these folders in the project root:
some/tmp/
some/tmpFolder/
some/realFolder/
Then the mvn clean
will delete the first two folders and leave the last one.