Maven 删除外部文件

标签 maven file-io

我正在使用 Eclipse/maven 插件。
我想删除具有绝对路径的外部文件,我有以下示例,但它声称仅删除驻留在项目中的相关文件

<plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>some/relative/path</directory>
                            <includes>
                                <include>**/*.tmp</include>
                                <include>**/*.log</include>
                            </includes>
                            <excludes>
                                <exclude>**/important.log</exclude>
                                <exclude>**/another-important.log</exclude>
                            </excludes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

最佳答案

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-clean-plugin</artifactId>
    <version>2.4.1</version>
    <configuration>
        <followSymLinks>false</followSymLinks>
        <filesets>
            <fileset>
            <directory>D:\apache-tomcat-6.0.24\webapps\cat360-web-1.0.0</directory>
            </fileset>
        </filesets>
    </configuration>
</plugin>

关于Maven 删除外部文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10265109/

相关文章:

Java 文件写入器 : Repeated File Open/Close(Multiple Instance) vs Single Open/Close(Single Instance) on Client-Server Environment

java - 在 Websphere 8.5 上使用 JMS 时出现 NoSuchMethodError 错误

maven-2 - 从原型(prototype)创建项目时如何抑制属性替换?

java - Maven:编译前替换源文件中的标记

maven - : Can't generate reports for Maven site (Maven 3. 0.x)

java - 尝试创建一个文件来保存图像Java

java file.renameTo() 重命名文件但返回 false。为什么?

C - 我可以将格式化时间输出到文本文件吗

java - 如何将列表传递到 Java 输入流?

maven - 指定的 XML 文件没有任何关联的样式表