maven clean插件使用进阶

参考

Maven clean 插件

Maven删除外部文件

查看命令帮助

mvn clean:help

mvn clean:help -Ddetail=true -Dgoal=clean

跳过clean和删除指定的文件夹

<properties>
<!--
方式一:跳过clean
3.0.0以前的版本属性是clean.skip,之后的属性是maven.clean.skip
-->
<!--<maven.clean.skip>true</maven.clean.skip>-->
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<!-- 方式二:跳过clean -->
<skip>true</skip> <filesets>
<!-- 删除文件夹generated -->
<fileset>
<directory>src/main/generated</directory>
</fileset>
<!-- 删除mozq文件夹中符合条件的,但是不会删除mozq文件夹 -->
<fileset>
<directory>src/main/mozq</directory>
<includes>
<include>*.txt</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ demo-01 ---
[INFO] Deleting D:\00\mozq_pro1\shiro\demo-01\src\main\generated (includes = [], excludes = [])
[INFO] Deleting D:\00\mozq_pro1\shiro\demo-01\src\main\mozq (includes = [*.txt], excludes = [])
[INFO] ------------------------------------------------------------------------

帮助

Maven Clean Plugin
The Maven Clean Plugin is a plugin that removes files generated at build-time
in a project's directory. clean:clean
Goal which cleans the build.
This attempts to clean a project's working directory of the files that were
generated at build-time. By default, it discovers and deletes the directories
configured in project.build.directory, project.build.outputDirectory,
project.build.testOutputDirectory, and project.reporting.outputDirectory. Files outside the default may also be included in the deletion by configuring
the filesets tag. Available parameters: excludeDefaultDirectories (Default: false)
Disables the deletion of the default output directories configured for a
project. If set to true, only the files/directories selected via the
parameter filesets will be deleted.
Expression: ${clean.excludeDefaultDirectories} failOnError (Default: true)
Indicates whether the build will continue even if there are clean errors.
Expression: ${maven.clean.failOnError} filesets
The list of file sets to delete, in addition to the default directories.
For example:
<filesets>
<fileset>
<directory>src/main/generated</directory>
<followSymlinks>false</followSymlinks>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>
<include>*.java</include>
</includes>
<excludes>
<exclude>Template*</exclude>
</excludes>
</fileset>
</filesets> followSymLinks (Default: false)
Sets whether the plugin should follow symbolic links while deleting files
from the default output directories of the project. Not following symlinks
requires more IO operations and heap memory, regardless whether symlinks
are actually present. So projects with a huge output directory that
knowingly does not contain symlinks can improve performance by setting
this parameter to true.
Expression: ${clean.followSymLinks} retryOnError (Default: true)
Indicates whether the plugin should undertake additional attempts (after a
short delay) to delete a file if the first attempt failed. This is meant
to help deleting files that are temporarily locked by third-party tools
like virus scanners or search indexing.
Expression: ${maven.clean.retryOnError} skip (Default: false)
Disables the plugin execution.
Expression: ${clean.skip} verbose
Sets whether the plugin runs in verbose mode. As of plugin version 2.3,
the default value is derived from Maven's global debug flag (compare
command line switch -X).
Expression: ${clean.verbose}

maven clean插件使用进阶的更多相关文章

  1. 学习Maven之Maven Clean Plugin

    1.maven-clean-plugin是个什么鬼? maven-clean-plugin这个插件用maven的人都不陌生.我们在执行命令mvn clean时调用的就是这个插件. 这个插件的主要作用就 ...

  2. Maven 的插件和生命周期的绑定

    一.Maven 的生命周期 Maven 的生命周期是对所有的构建过程进行抽象和统一.Maven 的生命周期是抽象的,这意味着生命周期本身不做任何实际的工作,生命周期只是定义了一系列的阶段,并确定这些阶 ...

  3. [maven] 常用插件解析

    参考资料:http://my.oschina.net/zh119893/blog/276090 我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完 ...

  4. maven+mybatis-generator插件反向生成源代码

    通过maven+mybatis-generator插件反向生成源代码,如有一个table表为resource,那么将自动生成这样三个文件:Resource.java类.ResourceMapper.j ...

  5. maven常用插件配置详解

    常用插件配置详解Java代码    <!-- 全局属性配置 --> <properties> <project.build.name>tools</proje ...

  6. Maven常用插件简单配置

    好久不见,甚是想念.一日不见,如隔三秋. 从春节到现在已经很久没有回归博客园了,今天回来温习一下maven常用的一些插件的配置,学东西一个很简单的诀窍就是重复重复再重复,这样一定能把知识掌握的很牢靠. ...

  7. Maven 默认插件以及功能

    Maven 默认插件 已知 Maven 使用 plugin 来执行实际操作的,在默认情况下,Maven 会绑定以下几个插件来完成基本操作. plugin function life cycle pha ...

  8. eclipse maven build、maven clean、maven install和maven test的区别 精析

          1.情景展示 选中maven项目,右键-->Run As或Debug As-->maven buid,maven install,maven test有什么区别? 2.区别说明 ...

  9. 13 Maven 编写插件

    Maven 编写插件 Maven 的任何行为都是由插件完成的,包括项目的清理.绵编译.测试以及打包等操作都有其对应的 Maven 插件.每个插件拥有一个或者多个目标,用户可以直接从命令行运行这些插件目 ...

随机推荐

  1. jQuery总结01_jq的基本概念+选择器

    jQuery基本概念 学习目标:学会如何使用jQuery,掌握jQuery的常用api,能够使用jQuery实现常见的效果. 为什么要学习jQuery? [01-让div显示与设置内容.html] 使 ...

  2. 最近几周,写了个微信好友检测助手App

    版权声明:本文为xing_star原创文章,转载请注明出处! 本文同步自http://javaexception.com/archives/130 微信好友检测助手App 最近几周,写了个微信好友检测 ...

  3. KVO-键值监听

    键值监听,就是可以监听对象某个属性值的变化: 首先,在工程中,新建一个Person的类 @interface Person : NSObject @property (nonatomic, copy) ...

  4. React Hook父组件获取子组件的数据/函数

    我们知道在react中,常用props实现子组件数据到父组件的传递,但是父组件调用子组件的功能却不常用.文档上说ref其实不是最佳的选择,但是想着偷懒不学redux,在网上找了很多教程,要不就是hoo ...

  5. 用Loading 加载中的整页加载来做蒙层

    总结:遇见的bug 如何写一个蒙层 最初我打算的是自己写一个蒙层,但是写出来后, 不能够将整个屏幕全部覆盖.只能够覆盖 除[顶部导航] 和[左侧菜单栏] 于是我就使用了element-ui中的 [Lo ...

  6. [C]副作用和序列点

    概述 副作用: <C语言核心技术>对副作用的描述: 表达式内包含了一串的常量.标识符.运算符(指示的运算方式).表达式的目的可以是获得结果值,或者得到运算的副作用(side effect) ...

  7. Less(6)

    1.先判断注入类型 (1)首先看到要求,要求传一个ID参数,并且要求是数字型的:?id=1 (2)再输入?id=1' (3)再输入?id=1 and 1=1 (4)再输入?id=1 and 1=2 ( ...

  8. Sass、LESS 和 Stylus各有千秋

    废话不多说直接上连接  为您详细比较三个 CSS 预处理器(框架):Sass.LESS 和 Stylus  

  9. JavaScript Array filter() 方法

    JavaScript Array filter() 方法 var ages = [32, 33, 16, 40]; function checkAdult(age) { return age > ...

  10. 织女星开发板启动模式修改——从ARM M4核启动

    前言 刚开始玩织女星开发板的时候,想先从熟悉的ARM核入手,连上Jlink,打开MDK版本的Demo程序,编译OK,却检测不到芯片,仔细看了一下文档,原来RV32M1芯片默认从RISC-V核启动,如果 ...