Maven Clean不删除文件 [英] Maven clean not deleting files

查看:775
本文介绍了Maven Clean不删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目录中有两个文件,如下所示:

I have two files in my directory like this:

  • a.b.so
  • a.so

我只想删除a.b.so.

这是我的pom.xml文件中的Maven清洁插件条目:

So here is my Maven clean plugin entry in my pom.xml file:

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

仅出于某种背景考虑,将文件a.b.so作为依赖项下载,然后在我执行上述条目之前将其重命名为a.so.我使用Maven Depedency插件复制文件.我不知道这是否会影响a.b.so的删除

Just for some backgorund of this, file a.b.so gets downloaded as a dependency then it gets renamed into a.so just before i execute the above entry. I copy file using maven depedency plugin. I don't know whether this affects the not deletion of a.b.so

反过来,它总是删除a.so.甚至我尝试包括**/*,但每次都会删除a.so.

In turn it always delete a.so. Even I tried including **/*, but it deletes a.so every time.

它永远不会删除a.b.so.

推荐答案

对于此特定示例,您可以尝试替换此部分:

For this particular example, you can try to replace this part:

  <includes>
    <include>*.so</include>
  </includes>
  <excludes>
   <exclude>a.so</exclude>
  <excludes>

  <includes>
    <include>a.b.so</include>
  </includes>

这篇关于Maven Clean不删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆