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. PlayJava Day029

    1.Java Reflection:Reflection(反射)是被视为动态语言的关键 反射机制允许程序在执行期借助于Reflection API取得任何类的内部信息 并能直接操作任意对象的内部属性及 ...

  2. 利用 uDig 生成 GeoServer 可用的 SLD 渲染文件

    利用 uDig 生成 GeoServer 可用的 SLD 渲染文件 uDig简介 uDig是一个 open source (EPL and BSD) 桌面应用程序框架,构建在Eclipse RCP和G ...

  3. 如何抓取 framework input 事件相关 log

    出现事件输入相关的问题时, 建议先 followhttp://429564140.iteye.com/blog/2355405来检测对应的设备是否有响应输入 如果没有响应输入,则可能是 driver ...

  4. Dotnetcore安装nuget包时不能使用content中的文件

    问题:用NUGET打包了一个asp.netcore的项目,试图安装到另一个asp.netcore项目中,除了自动添加引用外,还希望自动释放一些文件以供修改.这些操作以前在netframe中是正常的,脚 ...

  5. 023.[转] 尚硅谷_Maven笔记

  6. 增加sudo用户访问oracle

    增加zgy用户可以访问数据库[root@DBDATA ~]# useradd zgy--设置密码[root@DBDATA ~]# passwd zgy--设置组[root@DBDATA ~]# use ...

  7. 将 云数据库MongoDB(阿里云)物理备份文件下载恢复至本地自建数据库 遇到的5个问题

    有时候我们可能需要将云上数据库下载到本地,下面是我们在操作MongoDB数据库时遇到的五个小问题. 其实现在RDS的 帮助文档 写的都比较详细了,大家在第一次操作时,可以细读一下,避免一些不必要的问题 ...

  8. SQL语句性能调整原则

    一.问题的提出 在应用系统开发初期,由于开发数据库数据比较少,对于查询SQL语句,复杂视图的的编写等体会不出SQL语句各种写法的性能优劣,但是如果将应用系统提交实际应用后,随着数据库中数据的增加,系统 ...

  9. 对Windows桌面应用程序进行UI自动化测试

    题记:本文简述如何利用appium对Windows桌面应用程序进行UI自动化测试. 所谓UI自动化测试,就是模拟一个用户,对应用程序的UI进行操作,以完成特定场景的功能性集成测试. 要对Windows ...

  10. 每日JAVA面试