我的目录中有两个文件,如下所示:
我只想删除a.b.so
。
所以这是我的pom.xml
文件中的Maven clean插件条目:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>auto-clean</id>
<phase>prepare-package</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${project.build.directory}/libs/x86</directory>
<includes>
<include>*.so</include>
</includes>
<excludes>
<exclude>a.so</exclude>
<excludes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
对于某些backgorund,文件a.b.so作为依赖项下载,然后在执行上述条目之前将其重命名为a.so.我使用maven depedency插件复制文件。我不知道这是否会影响a.b.so
的删除反过来它总是删除a.so
。即使我尝试包含**/*
,但每次都会删除a.so
。
它永远不会删除a.b.so
。
答案 0 :(得分:0)
对于此特定示例,您可以尝试替换此部分:
<includes>
<include>*.so</include>
</includes>
<excludes>
<exclude>a.so</exclude>
<excludes>
带
<includes>
<include>a.b.so</include>
</includes>