2

运行后

mvn clean

尝试在我的项目中运行二进制文件时,我遇到了一个糟糕的时刻。首先选择的二进制文件没有运行 - 然后发现整个 /bin 目录已被删除。在一阵恐慌之后,结果发现——在持久/签入的文件中——只有bin 目录被删除了。

这是结果的片段mvn clean: 虽然libsdir 是可取的删除 .. 而bin 不是

--- maven-clean-plugin:2.5:clean (default-clean) @ parent ---
[INFO] Deleting /git/OCspark/bin (includes = [], excludes = [])
[INFO] Deleting /git/OCspark/libs (includes = [**/*.jar], excludes = [])

是否有配置来告知 clean 什么是“OK”可以擦除,什么是“禁区”?

4

1 回答 1

2

您可以配置 maven-clean-plugin 以包含和排除附加文件。检查任何现有的包含和排除。

或者,您可以尝试fileset在配置中分别使用 include 和 exclude 的两个 s,有点像(未测试):

<configuration>
  <filesets>
    <fileset>
      <directory>/git/OCspark/libs</directory>
      <includes>
        <include>**/*.*</include>
      </includes>
      <followSymlinks>false</followSymlinks>
    </fileset>
    <fileset>
      <directory>/git/OCspark/bin</directory>
      <excludes>
        <exclude>**/*.*</exclude>
      </excludes>
      <followSymlinks>false</followSymlinks>
    </fileset>
  </filesets>
</configuration>
于 2017-11-02T05:03:23.033 回答