Dez*_*ond 5 maven maven-clean-plugin
我正在尝试使用“maven-clean-plugin”来删除位于 /my/path 文件夹中的其他文件。
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<executions>
<execution>
<id>clean-on-cleaning</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<filesets>
<fileset>
<directory>target/dart</directory>
</fileset>
<fileset>
<directory>src/main/dart/.pub</directory>
</fileset>
<fileset>
<directory>src/main/dart/build</directory>
</fileset>
<fileset>
<directory>${env.APPDATA}/Pub/Cache</directory>
</fileset>
<fileset>
<directory>src/main/dart/packages</directory>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
Run Code Online (Sandbox Code Playgroud)
“src/main/dart/packages”包含链接。其中一个链接指向“src/main/dart/lib”文件夹。我已经设定:
<followSymlinks>false</followSymlinks>
Run Code Online (Sandbox Code Playgroud)
所以它不应该删除 lib 目录中的文件。但不幸的是它确实如此。问题可能出在哪里?
环境配置:
maven-clean-plugin根据您的配置判断,您正在使用来自生命周期默认绑定的版本clean。这是 Maven 3.3.3 的 2.5 版本。
对于这个版本,有一个错误,不maven-clean-plugin尊重followSymLinksWindows 上的属性:它是MCLEAN-58:
Maven Clean Plugin 在 Windows 上忽略 followSymLinks 参数
根据此错误报告,对于 Java >= 7 的用户(这就是您的情况),此问题已在版本 2.6.1 中修复。
因此,您只需将您正在使用的版本更新maven-clean-plugin到2.6.1即可。当前版本是 3.0.0,因此您不妨更新到该版本:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- rest of configuration -->
</plugin>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
947 次 |
| 最近记录: |