clean:clean
清理之前的build文件。
这会尝试清除项目在构建时生成的文件。默认情况下,它会发现并删除在project.build.directory
,project.build.outputDirectory
,project.build.testOutputDirectory
和project.reporting.outputDirectory
中配置的目录 。
也可以通过配置filesets
删除默认值以外的文件。
可选参数
Name | Type | Since | Description | Default value | User property | Required |
---|---|---|---|---|---|---|
<excludeDefaultDirectories> | boolean | 2.3 | clean时只删除filesets 中的文件。从3.0.0 开始,该属性已从clean.excludeDefaultDirectories 重命名为maven.clean.excludeDefaultDirectories 。 | false | maven.clean.excludeDefaultDirectories | |
<failOnError> | boolean | 2.2 | clean时发生error,build是否仍将继续。 | true | maven.clean.failOnError | |
<filesets> | Fileset[] | 2.1 | 除默认目录外,要删除的文件列表。
| |||
<followSymLinks> | boolean | 2.1 | Sets whether the plugin should follow symbolic links while deleting files from the default output directories of the project.无论符号链接是否实际存在,不遵循符号链接需要更多的IO操作和堆内存。因此,具有巨大输出目录的项目有意识地不包含符号链接,可以通过将此参数设置为true来提高性能。从3.0.0开始,该属性已从clean.followSymLinks 重命名 为maven.clean.followSymLinks 。 | false | maven.clean.followSymLinks | |
<retryOnError> | boolean | 2.4.2 | 是否应在第一次删除失败时进行额外尝试(在短暂延迟之后)删除文件。这有助于删除由病毒扫描程序或搜索索引等第三方工具暂时锁定的文件。 | true | maven.clean.retryOnError | |
<skip> | boolean | 2.2 | 禁用本插件。从3.0.0开始,该属性已从clean.skip 重命名为maven.clean.skip 。 | false | maven.clean.skip | |
<verbose> | Boolean | 2.1 | 设置插件是否以详细模式运行。从插件版本2.3开始,默认值来自Maven的全局调试标志(compare command line switch -X )。从3.0.0开始,该属性已从clean.verbose 重命名为maven.clean.verbose 。 | maven.clean.verbose |